本文整理汇总了Python中sqlite3.threadsafety方法的典型用法代码示例。如果您正苦于以下问题:Python sqlite3.threadsafety方法的具体用法?Python sqlite3.threadsafety怎么用?Python sqlite3.threadsafety使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sqlite3
的用法示例。
在下文中一共展示了sqlite3.threadsafety方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_basic_store
# 需要导入模块: import sqlite3 [as 别名]
# 或者: from sqlite3 import threadsafety [as 别名]
def test_basic_store(self):
assert sqlite3.threadsafety == 1
blocks = bt.get_consecutive_blocks(test_constants, 9, [], 9, b"0")
blocks_alt = bt.get_consecutive_blocks(test_constants, 3, [], 9, b"1")
db = await SyncStore.create()
db_2 = await SyncStore.create()
# Save/get sync
for sync_mode in (False, True):
db.set_sync_mode(sync_mode)
assert sync_mode == db.get_sync_mode()
genesis = FullBlock.from_bytes(test_constants["GENESIS_BLOCK"])
# clear sync info
await db.clear_sync_info()
# add/get potential tip, get potential tips num
db.add_potential_tip(blocks[6])
assert blocks[6] == db.get_potential_tip(blocks[6].header_hash)
示例2: CheckThreadSafety
# 需要导入模块: import sqlite3 [as 别名]
# 或者: from sqlite3 import threadsafety [as 别名]
def CheckThreadSafety(self):
self.assertEqual(sqlite.threadsafety, 1,
"threadsafety is %d, should be 1" % sqlite.threadsafety)
示例3: CheckThreadSafety
# 需要导入模块: import sqlite3 [as 别名]
# 或者: from sqlite3 import threadsafety [as 别名]
def CheckThreadSafety(self):
self.assertEqual(sqlite.threadsafety, 1,
'threadsafety is %d, should be 1' % sqlite.threadsafety)