diff options
Diffstat (limited to 'tests/flow')
| -rw-r--r-- | tests/flow/__init__.py | 16 | ||||
| -rw-r--r-- | tests/flow/test_tasks.py | 17 |
2 files changed, 28 insertions, 5 deletions
diff --git a/tests/flow/__init__.py b/tests/flow/__init__.py index e69de29..3c88c7e 100644 --- a/tests/flow/__init__.py +++ b/tests/flow/__init__.py @@ -0,0 +1,16 @@ +# def test_a_hit(): +# hit_type = HitType( +# title="Sandbox Test 2026-02-04", +# description="test description", +# reward=USDCent(5), +# keywords="a,b,c", +# min_active=10, +# ) +# AMTManager.create_hit_type(hit_type=hit_type) +# HTM.create(hit_type) + +# hit_type = HTM.get(amt_hit_type_id=hit_type.amt_hit_type_id) +# hit = create_hit_from_hittype(hit_type) + +# hit_type = HTM.get(amt_hit_type_id="3QMCR5SRRVWV0O3UDSC64VSB8KL4GL") +# hit = create_hit_from_hittype(hit_type) diff --git a/tests/flow/test_tasks.py b/tests/flow/test_tasks.py index 2aeffb9..3a71504 100644 --- a/tests/flow/test_tasks.py +++ b/tests/flow/test_tasks.py @@ -227,8 +227,8 @@ class TestProcessAssignmentSubmitted: ..., GetAssignmentResponseTypeDef ], assignment_response_no_tsid: GetAssignmentResponseTypeDef, - assignment_factory: Callable[..., Assignment], - hit_record: Hit, + assignment_record_factory: Callable[..., Assignment], + hit_record: Hit, # used in assignment_factory amt_worker_id: str, ): # An assignment is submitted. The hit and assignment stub exist in the DB. @@ -237,9 +237,16 @@ class TestProcessAssignmentSubmitted: # Going to create and submit 3 assignments w no work # (all on the same hit, which we don't do in JB for real, # but doesn't matter here) - _a1 = assignment_factory(hit_id=hit_record.id, amt_worker_id=amt_worker_id) - _a2 = assignment_factory(hit_id=hit_record.id, amt_worker_id=amt_worker_id) - _a3 = assignment_factory(hit_id=hit_record.id, amt_worker_id=amt_worker_id) + _a1 = assignment_record_factory( + hit_id=hit_record.id, amt_worker_id=amt_worker_id + ) + _a2 = assignment_record_factory( + hit_id=hit_record.id, amt_worker_id=amt_worker_id + ) + _a3 = assignment_record_factory( + hit_id=hit_record.id, amt_worker_id=amt_worker_id + ) + assert am.missing_tsid_count(amt_worker_id=amt_worker_id) == 3 # So now, we'll reject, b/c they've already gotten 3 warnings |
