def test_init():
# Delete existing DB to init from a clean state
if os.path.exists(MOCK_DB_FILE):
os.remove(MOCK_DB_FILE)
db = SqliteStore(MockConfig())
assert db
# Only the Global CIDR should appear here
assert len(db.query_all()) == 1
# Forcibly destroy DB object to close connection
gc.disable()
del db
gc.enable()
# Test the existing DB
db = SqliteStore(MockConfig())
# Again, only the Global CIDR should appear
assert len(db.query_all()) == 1
# Cleanup
os.remove(MOCK_DB_FILE)
评论列表
文章目录