feat: Add API endpoint for managing categories

This commit is contained in:
2026-07-03 08:33:48 +05:30
parent be6c95c497
commit 8488e3bdd0
15 changed files with 413 additions and 48 deletions

View File

@@ -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"