当前位置: 首页>>代码示例>>Python>>正文


Python test_support.unlink函数代码示例

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


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

示例1: test07_DB_set_flags_persists

 def test07_DB_set_flags_persists(self):
     if db.version() < (4,2):
         # The get_flags API required for this to work is only available
         # in Berkeley DB >= 4.2
         return
     try:
         db1 = db.DB()
         db1.set_flags(db.DB_DUPSORT)
         db1.open(self.filename, db.DB_HASH, db.DB_CREATE)
         db1['a'] = 'eh'
         db1['a'] = 'A'
         self.assertEqual([('a', 'A')], db1.items())
         db1.put('a', 'Aa')
         self.assertEqual([('a', 'A'), ('a', 'Aa')], db1.items())
         db1.close()
         db1 = db.DB()
         # no set_flags call, we're testing that it reads and obeys
         # the flags on open.
         db1.open(self.filename, db.DB_HASH)
         self.assertEqual([('a', 'A'), ('a', 'Aa')], db1.items())
         # if it read the flags right this will replace all values
         # for key 'a' instead of adding a new one.  (as a dict should)
         db1['a'] = 'new A'
         self.assertEqual([('a', 'new A')], db1.items())
     finally:
         db1.close()
         test_support.unlink(self.filename)
开发者ID:CaoYouXin,项目名称:myfirstapicloudapp,代码行数:27,代码来源:test_misc.py

示例2: 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.unlink(self.filename)
开发者ID:AojiaoZero,项目名称:CrossApp,代码行数:7,代码来源:test_dbshelve.py

示例3: test05_double_free_make_key_dbt

    def test05_double_free_make_key_dbt(self):
        try:
            db1 = db.DB()
            db1.open(self.filename, None, db.DB_BTREE, db.DB_CREATE | db.DB_THREAD)
            curs = db1.cursor()
            t = curs.get('/foo', db.DB_SET)
        finally:
            db1.close()
            test_support.unlink(self.filename)

        return
开发者ID:webiumsk,项目名称:WOT-0.9.15.1,代码行数:11,代码来源:test_misc.py

示例4: test05_double_free_make_key_dbt

    def test05_double_free_make_key_dbt(self):
        try:
            db1 = db.DB()
            db1.open(self.filename, None, db.DB_BTREE,
                     db.DB_CREATE | db.DB_THREAD)

            curs = db1.cursor()
            t = curs.get("/foo", db.DB_SET)
            # double free happened during exit from DBC_get
        finally:
            db1.close()
            test_support.unlink(self.filename)
开发者ID:jsyadav,项目名称:CrawlerFramework,代码行数:12,代码来源:test_misc.py

示例5: test06_key_with_null_bytes

 def test06_key_with_null_bytes(self):
     try:
         db1 = db.DB()
         db1.open(self.filename, None, db.DB_HASH, db.DB_CREATE)
         db1['a'] = 'eh?'
         db1['a\x00'] = 'eh zed.'
         db1['a\x00a'] = 'eh zed eh?'
         db1['aaa'] = 'eh eh eh!'
         keys = db1.keys()
         keys.sort()
         self.assertEqual(['a', 'a\x00', 'a\x00a', 'aaa'], keys)
         self.assertEqual(db1['a'], 'eh?')
         self.assertEqual(db1['a\x00'], 'eh zed.')
         self.assertEqual(db1['a\x00a'], 'eh zed eh?')
         self.assertEqual(db1['aaa'], 'eh eh eh!')
     finally:
         db1.close()
         test_support.unlink(self.filename)
开发者ID:jsyadav,项目名称:CrawlerFramework,代码行数:18,代码来源:test_misc.py

示例6: test07_DB_set_flags_persists

 def test07_DB_set_flags_persists(self):
     try:
         db1 = db.DB()
         db1.set_flags(db.DB_DUPSORT)
         db1.open(self.filename, db.DB_HASH, db.DB_CREATE)
         db1['a'] = 'eh'
         db1['a'] = 'A'
         self.assertEqual([('a', 'A')], db1.items())
         db1.put('a', 'Aa')
         self.assertEqual([('a', 'A'), ('a', 'Aa')], db1.items())
         db1.close()
         db1 = db.DB()
         db1.open(self.filename, db.DB_HASH)
         self.assertEqual([('a', 'A'), ('a', 'Aa')], db1.items())
         db1['a'] = 'new A'
         self.assertEqual([('a', 'new A')], db1.items())
     finally:
         db1.close()
         test_support.unlink(self.filename)
开发者ID:webiumsk,项目名称:WOT-0.9.15.1,代码行数:19,代码来源:test_misc.py

示例7: 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

示例8: 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

示例9: tearDown

 def tearDown(self):
     self.db.close()
     del self.db
     test_support.unlink(self.path)
开发者ID:webiumsk,项目名称:WOT-0.9.12,代码行数:4,代码来源:test_db.py


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