• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python test_support.rmtree函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中test_all.test_support.rmtree函数的典型用法代码示例。如果您正苦于以下问题:Python rmtree函数的具体用法?Python rmtree怎么用?Python rmtree使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了rmtree函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: tearDown

 def tearDown(self):
     import sys
     if sys.version_info[0] >= 3 :
         from test_all import do_proxy_db_py3k
         do_proxy_db_py3k(self._flag_proxy_db_py3k)
     self.do_close()
     test_support.rmtree(self.homeDir)
开发者ID:AojiaoZero,项目名称:CrossApp,代码行数:7,代码来源:test_dbshelve.py


示例2: setUp

    def setUp(self):
        if self.useEnv:
            self.homeDir = get_new_environment_path()
            try:
                self.env = db.DBEnv()
                self.env.set_lg_max(1024 * 1024)
                self.env.set_tx_max(30)
                self.env.set_tx_timestamp(int(time.time()))
                self.env.set_flags(self.envsetflags, 1)
                self.env.open(self.homeDir, self.envflags | db.DB_CREATE)
                self.filename = "test"
            # Yes, a bare except is intended, since we're re-raising the exc.
            except:
                test_support.rmtree(self.homeDir)
                raise
        else:
            self.env = None
            self.filename = get_new_database_path()

        # create and open the DB
        self.d = db.DB(self.env)
        self.d.set_flags(self.dbsetflags)
        if self.dbname:
            self.d.open(self.filename, self.dbname, self.dbtype,
                        self.dbopenflags | db.DB_CREATE, self.dbmode)
        else:
            self.d.open(
                self.filename,  # try out keyword args
                mode=self.dbmode,
                dbtype=self.dbtype,
                flags=self.dbopenflags | db.DB_CREATE)

        self.populateDB()
开发者ID:Rogerlin2013,项目名称:CrossApp,代码行数:33,代码来源:test_basics.py


示例3: setUp

    def setUp(self):
        if self.useEnv:
            self.homeDir = get_new_environment_path()
            try:
                self.env = db.DBEnv()
                self.env.set_lg_max(1048576)
                self.env.set_tx_max(30)
                self._t = int(time.time())
                self.env.set_tx_timestamp(self._t)
                self.env.set_flags(self.envsetflags, 1)
                self.env.open(self.homeDir, self.envflags | db.DB_CREATE)
                self.filename = 'test'
            except:
                test_support.rmtree(self.homeDir)
                raise

        else:
            self.env = None
            self.filename = get_new_database_path()
        self.d = db.DB(self.env)
        if not self.useEnv:
            self.d.set_cachesize(*self.cachesize)
            cachesize = self.d.get_cachesize()
            self.assertEqual(cachesize[0], self.cachesize[0])
            self.assertEqual(cachesize[2], self.cachesize[2])
            self.assertEqual(125, int(100.0 * cachesize[1] / self.cachesize[1]))
        self.d.set_flags(self.dbsetflags)
        if self.dbname:
            self.d.open(self.filename, self.dbname, self.dbtype, self.dbopenflags | db.DB_CREATE, self.dbmode)
        else:
            self.d.open(self.filename, mode=self.dbmode, dbtype=self.dbtype, flags=self.dbopenflags | db.DB_CREATE)
        if not self.useEnv:
            self.assertRaises(db.DBInvalidArgError, self.d.set_cachesize, *self.cachesize)
        self.populateDB()
        return
开发者ID:webiumsk,项目名称:WOT-0.9.14-CT,代码行数:35,代码来源:test_basics.py


示例4: tearDown

    def tearDown(self):
        if self.dbClient:
            self.dbClient.close()
        if self.dbMaster:
            self.dbMaster.close()
        self.m2c.put(None)
        self.c2m.put(None)
        self.t_m.join()
        self.t_c.join()

        # Here we assign dummy event handlers to allow GC of the test object.
        # Since the dummy handler doesn't use any outer scope variable, it
        # doesn't keep any reference to the test object.
        def dummy(*args):
            pass

        self.dbenvMaster.set_event_notify(dummy)
        self.dbenvClient.set_event_notify(dummy)
        self.dbenvMaster.rep_set_transport(13, dummy)
        self.dbenvClient.rep_set_transport(3, dummy)

        self.dbenvClient.close()
        self.dbenvMaster.close()
        test_support.rmtree(self.homeDirClient)
        test_support.rmtree(self.homeDirMaster)
开发者ID:canuckistani,项目名称:Planet-Jetpack,代码行数:25,代码来源:test_replication.py


示例5: tearDown

 def tearDown(self):
     self.closeDB()
     if self.env is not None:
         self.env.close()
         self.env = None
     test_support.rmtree(self.homeDir)
     return
开发者ID:webiumsk,项目名称:WOT-0.9.15-CT,代码行数:7,代码来源:test_compare.py


示例6: tearDown

 def tearDown(self):
     self.d.close()
     if self.env is not None:
         self.env.close()
         test_support.rmtree(self.homeDir)
     else:
         os.remove(self.filename)
开发者ID:AtomicConductor,项目名称:conductor_client,代码行数:7,代码来源:test_basics.py


示例7: tearDown

 def tearDown(self):
     self.secondary_db.close()
     self.primary_db.close()
     self.env.close()
     del self.secondary_db
     del self.primary_db
     del self.env
     test_support.rmtree(self.homeDir)
开发者ID:webiumsk,项目名称:WOT-0.9.12-CT,代码行数:8,代码来源:test_cursor_pget_bug.py


示例8: tearDown

 def tearDown(self):
     if self.dbClient :
         self.dbClient.close()
     if self.dbMaster :
         self.dbMaster.close()
     self.dbenvClient.close()
     self.dbenvMaster.close()
     test_support.rmtree(self.homeDirClient)
     test_support.rmtree(self.homeDirMaster)
开发者ID:AojiaoZero,项目名称:CrossApp,代码行数:9,代码来源:test_replication.py


示例9: tearDown

 def tearDown(self):
     if hasattr(self, "seq"):
         self.seq.close()
         del self.seq
     if hasattr(self, "d"):
         self.d.close()
         del self.d
     if hasattr(self, "dbenv"):
         self.dbenv.close()
         del self.dbenv
     test_support.rmtree(self.homeDir)
开发者ID:webiumsk,项目名称:WOT-0.9.14-CT,代码行数:11,代码来源:test_sequence.py


示例10: tearDown

    def tearDown(self):
        self.db.close()
        del self.db
        self.env.close()
        del self.env
        test_support.rmtree(self.homeDir)

        def test_flags(self):
            self.db.set_flags(db.DB_CHKSUM)
            self.assertEqual(db.DB_CHKSUM, self.db.get_flags())
            self.db.set_flags(db.DB_TXN_NOT_DURABLE)
            self.assertEqual(db.DB_TXN_NOT_DURABLE | db.DB_CHKSUM, self.db.get_flags())
开发者ID:webiumsk,项目名称:WOT-0.9.12,代码行数:12,代码来源:test_db.py


示例11: tearDown

    def tearDown(self):
        if self.dbClient:
            self.dbClient.close()
        if self.dbMaster:
            self.dbMaster.close()

        def dummy(*args):
            pass

        self.dbenvMaster.set_event_notify(dummy)
        self.dbenvClient.set_event_notify(dummy)
        self.dbenvClient.close()
        self.dbenvMaster.close()
        test_support.rmtree(self.homeDirClient)
        test_support.rmtree(self.homeDirMaster)
开发者ID:webiumsk,项目名称:WOT-0.9.14-CT,代码行数:15,代码来源:test_replication.py


示例12: setUp

    def setUp(self):
        if self.useEnv:
            self.homeDir=get_new_environment_path()
            try:
                self.env = db.DBEnv()
                self.env.set_lg_max(1024*1024)
                self.env.set_tx_max(30)
                self._t = int(time.time())
                self.env.set_tx_timestamp(self._t)
                self.env.set_flags(self.envsetflags, 1)
                self.env.open(self.homeDir, self.envflags | db.DB_CREATE)
                self.filename = "test"
            # Yes, a bare except is intended, since we're re-raising the exc.
            except:
                test_support.rmtree(self.homeDir)
                raise
        else:
            self.env = None
            self.filename = get_new_database_path()

        # create and open the DB
        self.d = db.DB(self.env)
        if not self.useEnv :
            if db.version() >= (4, 2) :
                self.d.set_cachesize(*self.cachesize)
                cachesize = self.d.get_cachesize()
                self.assertEqual(cachesize[0], self.cachesize[0])
                self.assertEqual(cachesize[2], self.cachesize[2])
                # Berkeley DB expands the cache 25% accounting overhead,
                # if the cache is small.
                self.assertEqual(125, int(100.0*cachesize[1]/self.cachesize[1]))
        self.d.set_flags(self.dbsetflags)
        if self.dbname:
            self.d.open(self.filename, self.dbname, self.dbtype,
                        self.dbopenflags|db.DB_CREATE, self.dbmode)
        else:
            self.d.open(self.filename,   # try out keyword args
                        mode = self.dbmode,
                        dbtype = self.dbtype,
                        flags = self.dbopenflags|db.DB_CREATE)

        if not self.useEnv:
            self.assertRaises(db.DBInvalidArgError,
                    self.d.set_cachesize, *self.cachesize)

        self.populateDB()
开发者ID:kanbang,项目名称:Colt,代码行数:46,代码来源:test_basics.py


示例13: tearDown

 def tearDown(self):
     test_support.unlink(self.db_path_1)
     test_support.unlink(self.db_path_2)
     test_support.rmtree(self.db_env_path)
开发者ID:2uller,项目名称:LotF,代码行数:4,代码来源:test_fileid.py


示例14: tearDown

 def tearDown(self):
     test_support.rmtree(self.homeDir)
开发者ID:1018365842,项目名称:FreeIMU,代码行数:2,代码来源:test_early_close.py


示例15: tearDown

 def tearDown(self):
     self.closeDB()
     self.env.close()
     self.env = None
     test_support.rmtree(self.homeDir)
开发者ID:jsyadav,项目名称:CrawlerFramework,代码行数:5,代码来源:test_associate.py


示例16: tearDown

 def tearDown(self):
     if hasattr(self, 'db'):
         del self.db
     if hasattr(self, 'env'):
         del self.env
     test_support.rmtree(self.homeDir)
开发者ID:0xcc,项目名称:pyston,代码行数:6,代码来源:test_dbobj.py


示例17: tearDown

 def tearDown(self):
     del self.env
     test_support.rmtree(self.homeDir)
开发者ID:kanbang,项目名称:Colt,代码行数:3,代码来源:test_dbenv.py


示例18: tearDown

 def tearDown(self):
     self.env.close()
     del self.env
     test_support.rmtree(self.homeDir)
开发者ID:webiumsk,项目名称:WOT-0.9.15-CT,代码行数:4,代码来源:test_dbenv.py


示例19: tearDown

 def tearDown(self):
     test_support.unlink(self.filename)
     test_support.rmtree(self.homeDir)
开发者ID:webiumsk,项目名称:WOT-0.9.15.1,代码行数:3,代码来源:test_misc.py


示例20: tearDown

 def tearDown(self):
     self._destroy_env()
     test_support.rmtree(self.homeDir)
开发者ID:2uller,项目名称:LotF,代码行数:3,代码来源:test_distributed_transactions.py



注:本文中的test_all.test_support.rmtree函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python test_support.unlink函数代码示例发布时间:2022-05-27
下一篇:
Python db.version函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap