def test_query_one():
db = SqliteStore(config=MockConfig())
# Due to pytest.mark, this test runs after the insert,
# so we should have this RegisteredCidr
cidr = db.query_one(TEST_CIDR)
assert cidr.cidr == TEST_CIDR
assert cidr.description == TEST_DESCRIPTION
assert cidr.location == TEST_LOCATION
assert cidr.owner == TEST_OWNER
assert cidr.expiration == TEST_EXPIRATION
fake_cidr = db.query_one("FAKE CIDR")
assert fake_cidr is None
评论列表
文章目录