This commit is contained in:
@@ -168,7 +168,7 @@ class TestCreditService:
|
||||
mock_socket_manager.send_to_user = AsyncMock()
|
||||
|
||||
transaction = await credit_service.deduct_credits(
|
||||
1, CreditActionType.VLC_PLAY_SOUND, True, {"test": "data"},
|
||||
1, CreditActionType.VLC_PLAY_SOUND, success=True, metadata={"test": "data"},
|
||||
)
|
||||
|
||||
# Verify user credits were updated
|
||||
@@ -214,7 +214,7 @@ class TestCreditService:
|
||||
mock_socket_manager.send_to_user = AsyncMock()
|
||||
|
||||
transaction = await credit_service.deduct_credits(
|
||||
1, CreditActionType.VLC_PLAY_SOUND, False, # Action failed
|
||||
1, CreditActionType.VLC_PLAY_SOUND, success=False, # Action failed
|
||||
)
|
||||
|
||||
# Verify user credits were NOT updated (action requires success)
|
||||
@@ -256,7 +256,7 @@ class TestCreditService:
|
||||
|
||||
with pytest.raises(InsufficientCreditsError):
|
||||
await credit_service.deduct_credits(
|
||||
1, CreditActionType.VLC_PLAY_SOUND, True,
|
||||
1, CreditActionType.VLC_PLAY_SOUND, success=True,
|
||||
)
|
||||
|
||||
# Verify no socket event was emitted since credits could not be deducted
|
||||
|
||||
Reference in New Issue
Block a user