diff options
| author | Max Nanis | 2026-03-06 16:49:46 -0500 |
|---|---|---|
| committer | Max Nanis | 2026-03-06 16:49:46 -0500 |
| commit | 91d040211a4ed6e4157896256a762d3854777b5e (patch) | |
| tree | cd95922ea4257dc8d3f4e4cbe8534474709a20dc /tests/managers/thl/test_ledger/test_lm_tx_entries.py | |
| download | generalresearch-91d040211a4ed6e4157896256a762d3854777b5e.tar.gz generalresearch-91d040211a4ed6e4157896256a762d3854777b5e.zip | |
Initial commitv3.3.4
Diffstat (limited to 'tests/managers/thl/test_ledger/test_lm_tx_entries.py')
| -rw-r--r-- | tests/managers/thl/test_ledger/test_lm_tx_entries.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/managers/thl/test_ledger/test_lm_tx_entries.py b/tests/managers/thl/test_ledger/test_lm_tx_entries.py new file mode 100644 index 0000000..5bf1c48 --- /dev/null +++ b/tests/managers/thl/test_ledger/test_lm_tx_entries.py @@ -0,0 +1,26 @@ +from generalresearch.models.thl.ledger import LedgerEntry + + +class TestLedgerEntryManager: + + def test_get_tx_entries_by_tx(self, ledger_tx, lm): + # First confirm the Ledger TX exists with 2 Entries + res = lm.get_tx_by_id(transaction_id=ledger_tx.id) + assert len(res.entries) == 2 + + tx_entries = lm.get_tx_entries_by_tx(transaction=ledger_tx) + assert len(tx_entries) == 2 + + assert res.entries == tx_entries + assert isinstance(tx_entries[0], LedgerEntry) + + def test_get_tx_entries_by_txs(self, ledger_tx, lm): + # First confirm the Ledger TX exists with 2 Entries + res = lm.get_tx_by_id(transaction_id=ledger_tx.id) + assert len(res.entries) == 2 + + tx_entries = lm.get_tx_entries_by_txs(transactions=[ledger_tx]) + assert len(tx_entries) == 2 + + assert res.entries == tx_entries + assert isinstance(tx_entries[0], LedgerEntry) |
