This commit is contained in:
@@ -45,10 +45,10 @@ class TestRequiresCreditsDecorator:
|
||||
|
||||
assert result == "Success: test"
|
||||
mock_credit_service.validate_and_reserve_credits.assert_called_once_with(
|
||||
123, CreditActionType.VLC_PLAY_SOUND, None,
|
||||
123, CreditActionType.VLC_PLAY_SOUND,
|
||||
)
|
||||
mock_credit_service.deduct_credits.assert_called_once_with(
|
||||
123, CreditActionType.VLC_PLAY_SOUND, True, None,
|
||||
123, CreditActionType.VLC_PLAY_SOUND, success=True, metadata=None,
|
||||
)
|
||||
|
||||
@pytest.mark.asyncio
|
||||
@@ -70,10 +70,10 @@ class TestRequiresCreditsDecorator:
|
||||
await test_action(user_id=123, sound_name="test.mp3")
|
||||
|
||||
mock_credit_service.validate_and_reserve_credits.assert_called_once_with(
|
||||
123, CreditActionType.VLC_PLAY_SOUND, {"sound_name": "test.mp3"},
|
||||
123, CreditActionType.VLC_PLAY_SOUND,
|
||||
)
|
||||
mock_credit_service.deduct_credits.assert_called_once_with(
|
||||
123, CreditActionType.VLC_PLAY_SOUND, True, {"sound_name": "test.mp3"},
|
||||
123, CreditActionType.VLC_PLAY_SOUND, success=True, metadata={"sound_name": "test.mp3"},
|
||||
)
|
||||
|
||||
@pytest.mark.asyncio
|
||||
@@ -92,7 +92,7 @@ class TestRequiresCreditsDecorator:
|
||||
|
||||
assert result is False
|
||||
mock_credit_service.deduct_credits.assert_called_once_with(
|
||||
123, CreditActionType.VLC_PLAY_SOUND, False, None,
|
||||
123, CreditActionType.VLC_PLAY_SOUND, success=False, metadata=None,
|
||||
)
|
||||
|
||||
@pytest.mark.asyncio
|
||||
@@ -111,7 +111,7 @@ class TestRequiresCreditsDecorator:
|
||||
await test_action(user_id=123)
|
||||
|
||||
mock_credit_service.deduct_credits.assert_called_once_with(
|
||||
123, CreditActionType.VLC_PLAY_SOUND, False, None,
|
||||
123, CreditActionType.VLC_PLAY_SOUND, success=False, metadata=None,
|
||||
)
|
||||
|
||||
@pytest.mark.asyncio
|
||||
@@ -149,7 +149,7 @@ class TestRequiresCreditsDecorator:
|
||||
|
||||
assert result == "test"
|
||||
mock_credit_service.validate_and_reserve_credits.assert_called_once_with(
|
||||
123, CreditActionType.VLC_PLAY_SOUND, None,
|
||||
123, CreditActionType.VLC_PLAY_SOUND,
|
||||
)
|
||||
|
||||
@pytest.mark.asyncio
|
||||
@@ -228,10 +228,10 @@ class TestCreditManager:
|
||||
manager.mark_success()
|
||||
|
||||
mock_credit_service.validate_and_reserve_credits.assert_called_once_with(
|
||||
123, CreditActionType.VLC_PLAY_SOUND, {"test": "data"},
|
||||
123, CreditActionType.VLC_PLAY_SOUND,
|
||||
)
|
||||
mock_credit_service.deduct_credits.assert_called_once_with(
|
||||
123, CreditActionType.VLC_PLAY_SOUND, True, {"test": "data"},
|
||||
123, CreditActionType.VLC_PLAY_SOUND, success=True, metadata={"test": "data"},
|
||||
)
|
||||
|
||||
@pytest.mark.asyncio
|
||||
@@ -246,7 +246,7 @@ class TestCreditManager:
|
||||
pass
|
||||
|
||||
mock_credit_service.deduct_credits.assert_called_once_with(
|
||||
123, CreditActionType.VLC_PLAY_SOUND, False, None,
|
||||
123, CreditActionType.VLC_PLAY_SOUND, success=False, metadata=None,
|
||||
)
|
||||
|
||||
@pytest.mark.asyncio
|
||||
@@ -261,7 +261,7 @@ class TestCreditManager:
|
||||
raise ValueError("Test error")
|
||||
|
||||
mock_credit_service.deduct_credits.assert_called_once_with(
|
||||
123, CreditActionType.VLC_PLAY_SOUND, False, None,
|
||||
123, CreditActionType.VLC_PLAY_SOUND, success=False, metadata=None,
|
||||
)
|
||||
|
||||
@pytest.mark.asyncio
|
||||
|
||||
Reference in New Issue
Block a user