2023-06-03 19:22:49 +00:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
|
2023-06-03 21:09:50 +00:00
|
|
|
from tentacles.db import Db
|
2023-06-03 19:22:49 +00:00
|
|
|
|
|
|
|
|
2023-07-08 22:47:12 +00:00
|
|
|
def test_db_initializes(db: Db):
|
|
|
|
assert isinstance(db, Db)
|
2023-06-03 19:22:49 +00:00
|
|
|
|
|
|
|
|
2023-07-08 22:47:12 +00:00
|
|
|
def test_db_savepoint(db: Db):
|
|
|
|
obj = db.savepoint()
|
2023-06-03 19:22:49 +00:00
|
|
|
|
|
|
|
assert hasattr(obj, "__enter__")
|
|
|
|
assert hasattr(obj, "__exit__")
|
|
|
|
|
|
|
|
flag = False
|
|
|
|
with obj:
|
|
|
|
flag = True
|
|
|
|
assert flag
|