diff options
| author | Greg Stupp | 2026-09-18 22:39:18 +0000 |
|---|---|---|
| committer | Greg Stupp | 2026-09-18 22:39:18 +0000 |
| commit | b373b992cae3a9628a9cf64387c7b8e286d6e1e0 (patch) | |
| tree | 5e21759ea2c6925e8f54328fbbac88b6be007648 /tests/managers/thl/test_ledger/test_lm_tx_locks.py | |
| parent | 32f30b5ddc600e22e071f7659f1872a18ebf42c7 (diff) | |
| parent | e3c6a824f4176402e40217c5ce70f837dedc5c3d (diff) | |
| download | generalresearch-b373b992cae3a9628a9cf64387c7b8e286d6e1e0.tar.gz generalresearch-b373b992cae3a9628a9cf64387c7b8e286d6e1e0.zip | |
Merges pull request #4
v3.5.0
User Cashout Stuff pulled out of grpc, user ip history enrichments with grip (no maxmind)
Diffstat (limited to 'tests/managers/thl/test_ledger/test_lm_tx_locks.py')
| -rw-r--r-- | tests/managers/thl/test_ledger/test_lm_tx_locks.py | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/tests/managers/thl/test_ledger/test_lm_tx_locks.py b/tests/managers/thl/test_ledger/test_lm_tx_locks.py index 166598e..91d9cbc 100644 --- a/tests/managers/thl/test_ledger/test_lm_tx_locks.py +++ b/tests/managers/thl/test_ledger/test_lm_tx_locks.py @@ -38,7 +38,6 @@ logger = logging.getLogger("LedgerManager") class TestLedgerLocks: - def test_a( self, user_factory: Callable[..., User], @@ -108,16 +107,16 @@ class TestLedgerLocks: f1 = generate_condition_mp_payment(wall=w1) f2 = generate_condition_mp_payment(wall=w2) f3 = generate_condition_mp_payment(wall=w3) - assert f1(ledger_manager) is False - assert f2(lm=ledger_manager) is False - assert f3(lm=ledger_manager) is True + assert f1(ledger_manager) == (False, "duplicate tag") + assert f2(lm=ledger_manager) == (False, "duplicate tag") + assert f3(lm=ledger_manager)[0] == True condition = f3 create_tx_func = lambda: thl_ledger_manager.create_tx_task_complete_( wall=w3, user=user ) assert isinstance(create_tx_func, Callable) - assert f3(ledger_manager) is True + assert f3(ledger_manager)[0] is True ledger_manager.redis_client.delete(flag_name) ledger_manager.redis_client.delete(lock_name) @@ -125,13 +124,14 @@ class TestLedgerLocks: tx = thl_ledger_manager.create_tx_protected( lock_key=lock_key, condition=condition, create_tx_func=create_tx_func ) - assert f3(ledger_manager) is False + assert f3(ledger_manager) == (False, "duplicate tag") # purposely hold the lock open tx = None ledger_manager.redis_client.set(lock_name, "1") - with caplog.at_level(logging.ERROR), pytest.raises( - expected_exception=LedgerTransactionCreateLockError + with ( + caplog.at_level(logging.ERROR), + pytest.raises(expected_exception=LedgerTransactionCreateLockError), ): tx = thl_ledger_manager.create_tx_protected( lock_key=lock_key, @@ -231,8 +231,9 @@ class TestLedgerLocks: # Purposely hold the lock open ledger_manager.redis_client.set(name=lock_name, value="1") - with caplog.at_level(logging.DEBUG), pytest.raises( - expected_exception=LedgerTransactionCreateLockError + with ( + caplog.at_level(logging.DEBUG), + pytest.raises(expected_exception=LedgerTransactionCreateLockError), ): tx = thl_ledger_manager.create_tx_task_complete( wall=wall3, user=user, created=wall3.started |
