diff options
Diffstat (limited to 'tests/fixtures/flow.py')
| -rw-r--r-- | tests/fixtures/flow.py | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/tests/fixtures/flow.py b/tests/fixtures/flow.py index 5ee2026..dd2f83e 100644 --- a/tests/fixtures/flow.py +++ b/tests/fixtures/flow.py @@ -27,10 +27,10 @@ from generalresearchutils.models.thl.definitions import PayoutStatus @pytest.fixture def approved_assignment_stubs( assignment_response: GetAssignmentResponseTypeDef, - assignment_response_approved: Callable[[str], GetAssignmentResponseTypeDef], + assignment_response_factory_approved: Callable[[str], GetAssignmentResponseTypeDef], amt_assignment_id: str, amt_hit_id: str, - get_hit_response_reviewing: GetHITResponseTypeDef, + hit_response_reviewing: GetHITResponseTypeDef, ) -> Callable[..., list[Dict[str, Any]]]: # These are the AMT_CLIENT stubs/mocks that need to be set when running @@ -43,8 +43,8 @@ def approved_assignment_stubs( ) -> list[Dict[str, Any]]: response = override_response or assignment_response - approve_response = override_approve_response or assignment_response_approved( - feedback + approve_response = ( + override_approve_response or assignment_response_factory_approved(feedback) ) return [ @@ -74,7 +74,7 @@ def approved_assignment_stubs( }, { "operation": "get_hit", - "response": get_hit_response_reviewing, + "response": hit_response_reviewing, "expected_params": {"HITId": amt_hit_id}, }, ] @@ -218,7 +218,15 @@ def mock_thl_responses( class MockThlProfileResponse: def json(self): - return {"user_profile": {"user": {"blocked": user_blocked}}} + return { + "user_profile": { + "user": { + "product_id": settings.product_id, + "product_user_id": amt_worker_id, + "blocked": user_blocked, + } + } + } return MockThlProfileResponse() @@ -227,7 +235,10 @@ def mock_thl_responses( class MockThlWalletResponse: def json(self) -> Dict[str, Any]: return { - "wallet": {"redeemable_amount": wallet_redeemable_amount} + "wallet": { + "amount": wallet_redeemable_amount, + "redeemable_amount": wallet_redeemable_amount, + } } return MockThlWalletResponse() |
