Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update test
  • Loading branch information
axshani committed May 15, 2022
commit a94bce89392e0da83f61e131927337700cf0e811
33 changes: 14 additions & 19 deletions e2e_tests/transaction_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,25 +349,20 @@ def test_list_and_get_transactions_with_type():

def test_codecs_transactions():
import inspect
import unit.models.transaction as foo
import unit.models.transaction as umt

classes = []

p = 'unit.models.transaction.'
for name, obj in inspect.getmembers(foo):
if inspect.isclass(obj):
try:
s = str(obj)
if 'Transaction' in s and 'DTO' in s and 'Base' not in s:
i = s.index(p) + len(p)
j = s.index('DTO\'>')
classes.append(s[i:j])
except e:
print(e)
continue


transactions = [x.lower() for x in mappings if "Transaction" in x]
for c in classes:
if c.lower() not in transactions:
assert False

for name, obj in inspect.getmembers(umt):
try:
if 'Transaction' in name and 'DTO' in name and 'Base' not in name and name != 'TransactionDTO':
classes.append(name.replace('DTO', ''))
except Exception as e:
print(e)
continue


transactions = [x for x in mappings if "Transaction" in x]

assert len(transactions) == len(classes)