diff options
| author | Max Nanis | 2026-08-27 17:46:11 -0700 |
|---|---|---|
| committer | Max Nanis | 2026-08-27 17:46:11 -0700 |
| commit | aeeb7fef2594ccd34fbe96a77f6c5b392299fed7 (patch) | |
| tree | de0896615df0c9747208fc26eb1ddde60f248286 /tests/managers/thl/test_ledger/test_thl_lm_accounts.py | |
| parent | fdc170938ac4ac8fa5d9d4df1936e6dc0777f291 (diff) | |
| download | generalresearch-aeeb7fef2594ccd34fbe96a77f6c5b392299fed7.tar.gz generalresearch-aeeb7fef2594ccd34fbe96a77f6c5b392299fed7.zip | |
Ruff afternoon
Diffstat (limited to 'tests/managers/thl/test_ledger/test_thl_lm_accounts.py')
| -rw-r--r-- | tests/managers/thl/test_ledger/test_thl_lm_accounts.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/tests/managers/thl/test_ledger/test_thl_lm_accounts.py b/tests/managers/thl/test_ledger/test_thl_lm_accounts.py index dce9116..60eb71c 100644 --- a/tests/managers/thl/test_ledger/test_thl_lm_accounts.py +++ b/tests/managers/thl/test_ledger/test_thl_lm_accounts.py @@ -229,6 +229,7 @@ class TestThlLedgerManagerAccounts: # (1) known account and confirm it comes back res = ledger_manager.get_account(qualified_name=account1.qualified_name) + assert isinstance(res, LedgerAccount) assert account1.model_dump_json() == res.model_dump_json() # (2) known accounts and confirm they both come back @@ -291,6 +292,7 @@ class TestThlLedgerManagerAccounts: assert len(res) == 2 # Confirm an empty array comes back for all unknown qualified names + assert isinstance(ledger_manager.currency, LedgerCurrency) res = ledger_manager.get_accounts_if_exists( qualified_names=[ f"{ledger_manager.currency.value}:bp_wall:{uuid4().hex}" @@ -328,7 +330,7 @@ class TestThlLedgerManagerAccounts: product_uuids=product_uuids ) assert len(res) == len(product_uuids) - assert all([isinstance(i, LedgerAccount) for i in res]) + assert all(isinstance(i, LedgerAccount) for i in res) class TestLedgerAccountManager: @@ -351,10 +353,10 @@ class TestLedgerAccountManager: # First we want to validate that using the get_account method raises # an error for a random LedgerAccount which we know does not exist. with pytest.raises(LedgerAccountDoesntExistError): - lam.get_account(qualified_name=account.qualified_name) + ledger_account_manager.get_account(qualified_name=account.qualified_name) # Now that we know it doesn't exist, get_or_create for it - instance = lam.get_account_or_create(account=account) + instance = ledger_account_manager.get_account_or_create(account=account) # It should always return assert isinstance(instance, LedgerAccount) @@ -364,10 +366,11 @@ class TestLedgerAccountManager: self, user: User, thl_ledger_manager: ThlLedgerManager, - ledger_manager: LedgerManager, ledger_account_manager: LedgerAccountManager, ): + assert isinstance(user.product, Product) + with pytest.raises(LedgerAccountDoesntExistError): ledger_account_manager.get_account( qualified_name=f"test:bp_wallet:{user.product.id}" |
