-
-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
76 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
from botocore.stub import Stubber, ANY | ||
import pytest | ||
|
||
|
||
_mturk_list_hits_response = { | ||
'NumResults': 0, | ||
'HITs': [], | ||
'ResponseMetadata': { | ||
'RequestId': '00000000-4989-4ffc-85cd-aaaaaaaaaaaa', | ||
'HTTPStatusCode': 200, | ||
'HTTPHeaders': { | ||
'x-amzn-requestid': '00000000-4989-4ffc-85cd-aaaaaaaaaaaa', | ||
'content-type': 'application/x-amz-json-1.1', | ||
'content-length': '26', | ||
'date': 'Thu, 04 Jun 2020 00:48:16 GMT' | ||
}, | ||
'RetryAttempts': 0 | ||
} | ||
} | ||
|
||
|
||
# Unfortunately moto does not support mturk yet | ||
@pytest.mark.moto | ||
@pytest.mark.asyncio | ||
async def test_mturk_stubber(session): | ||
async with session.create_client('mturk', region_name='us-east-1') as client: | ||
with Stubber(client) as stubber: | ||
stubber.add_response('list_hits_for_qualification_type', | ||
_mturk_list_hits_response, | ||
{'QualificationTypeId': ANY}) | ||
|
||
response = await client.list_hi_ts_for_qualification_type( | ||
QualificationTypeId='string') | ||
assert response == _mturk_list_hits_response |