mirror of
https://github.com/sortedcord/alemno-payments.git
synced 2026-07-22 04:02:49 +05:30
feat: Add API endpoint for managing categories
This commit is contained in:
@@ -18,7 +18,9 @@ async def test_classify_transactions_batch_retry_success():
|
||||
{"txn_id": "TX2", "merchant": "Amazon", "amount": 1200.0},
|
||||
]
|
||||
|
||||
results = await classify_transactions_batch(mock_client, batch_txns)
|
||||
results = await classify_transactions_batch(
|
||||
mock_client, batch_txns, ["Food", "Shopping", "Other"]
|
||||
)
|
||||
assert len(results) == 2
|
||||
assert results["TX1"]["category"] == "Food"
|
||||
assert results["TX1"]["failed"] is False
|
||||
@@ -37,7 +39,9 @@ async def test_classify_transactions_batch_retry_failure():
|
||||
|
||||
# Patch sleep to make retry test run instantly
|
||||
with patch("asyncio.sleep", return_value=None):
|
||||
results = await classify_transactions_batch(mock_client, batch_txns)
|
||||
results = await classify_transactions_batch(
|
||||
mock_client, batch_txns, ["Food", "Shopping", "Other"]
|
||||
)
|
||||
|
||||
assert len(results) == 1
|
||||
assert results["TX1"]["category"] == "Other"
|
||||
|
||||
Reference in New Issue
Block a user