Skip to content

Commit

Permalink
new: test_transaction_list
Browse files Browse the repository at this point in the history
  • Loading branch information
aMahanna committed Sep 15, 2023
1 parent 51d1537 commit 3d6c241
Showing 1 changed file with 21 additions and 6 deletions.
27 changes: 21 additions & 6 deletions tests/test_transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,6 @@ def test_transaction_execute_raw(db, col, docs):
assert err.value.error_code == 10


def test_transaction_list(db, col, docs):
transactions = db.list_transactions()
assert isinstance(transactions, list)
# TODO: Add proper transaction test here


def test_transaction_init(db, bad_db, col, username):
txn_db = db.begin_transaction()

Expand Down Expand Up @@ -155,3 +149,24 @@ def test_transaction_graph(db, graph, fvcol, fvdocs):
assert len(vcol) == 0

txn_db.commit_transaction()


def test_transaction_list(db):
transactions = db.list_transactions()
assert transactions == []

txn_db = db.begin_transaction()
txn_db.aql.execute("RETURN 1")

txt_db_2 = db.begin_transaction()
txt_db_2.aql.execute("RETURN 1")

assert len(db.list_transactions()) == 2

txn_db.commit_transaction()

assert len(db.list_transactions()) == 1

txt_db_2.commit_transaction()

assert db.list_transactions() == []

0 comments on commit 3d6c241

Please sign in to comment.