3
3
import pytest
4
4
5
5
from arangoasync .database import TransactionDatabase
6
- from arangoasync .errno import FORBIDDEN , TRANSACTION_NOT_FOUND
6
+ from arangoasync .errno import BAD_PARAMETER , FORBIDDEN , TRANSACTION_NOT_FOUND
7
7
from arangoasync .exceptions import (
8
8
TransactionAbortError ,
9
9
TransactionCommitError ,
@@ -74,7 +74,8 @@ async def test_transaction_status(db, doc_col):
74
74
txn_db = db .fetch_transaction ("illegal" )
75
75
with pytest .raises (TransactionStatusError ) as err :
76
76
await txn_db .transaction_status ()
77
- assert err .value .error_code == TRANSACTION_NOT_FOUND
77
+ # Error code differs between single server and cluster mode
78
+ assert err .value .error_code in {BAD_PARAMETER , TRANSACTION_NOT_FOUND }
78
79
79
80
80
81
@pytest .mark .asyncio
@@ -101,7 +102,8 @@ async def test_transaction_commit(db, doc_col, docs):
101
102
txn_db = db .fetch_transaction ("illegal" )
102
103
with pytest .raises (TransactionCommitError ) as err :
103
104
await txn_db .commit_transaction ()
104
- assert err .value .error_code == TRANSACTION_NOT_FOUND
105
+ # Error code differs between single server and cluster mode
106
+ assert err .value .error_code in {BAD_PARAMETER , TRANSACTION_NOT_FOUND }
105
107
106
108
107
109
@pytest .mark .asyncio
@@ -126,7 +128,8 @@ async def test_transaction_abort(db, doc_col, docs):
126
128
txn_db = db .fetch_transaction ("illegal" )
127
129
with pytest .raises (TransactionAbortError ) as err :
128
130
await txn_db .abort_transaction ()
129
- assert err .value .error_code == TRANSACTION_NOT_FOUND
131
+ # Error code differs between single server and cluster mode
132
+ assert err .value .error_code in {BAD_PARAMETER , TRANSACTION_NOT_FOUND }
130
133
131
134
132
135
@pytest .mark .asyncio
0 commit comments