55async def test_claim_mentee_response_attachment_is_list (
66 action : dict , aiohttp_client , bot : SirBot
77):
8+ client , slack_mock = await create_mocks (aiohttp_client , bot )
9+
10+ await client .post ("/slack/actions" , data = action )
11+ assert isinstance (slack_mock .call_args [0 ][1 ]["attachments" ], list )
12+
13+
14+ async def test_claim_mentee_response_contains_original_text (
15+ action : dict , aiohttp_client , bot : SirBot
16+ ):
17+ client , slack_mock = await create_mocks (aiohttp_client , bot )
18+ await client .post ("/slack/actions" , data = action )
19+ request_payload = slack_mock .call_args [0 ][1 ]
20+ assert request_payload ["text" ] is not None
21+
22+
23+ async def create_mocks (aiohttp_client , bot ):
824 slack_mock = CoroutineMock (
925 return_value = {"user" : {"profile" : {"email" : "email@email.com" }}}
1026 )
@@ -14,7 +30,5 @@ async def test_claim_mentee_response_attachment_is_list(
1430 bot ["plugins" ]["airtable" ].api .update_request = airtable_mock
1531 bot ["plugins" ]["airtable" ].api .get_name_from_record_id = airtable_mock
1632 bot ["plugins" ]["airtable" ].api .get_row_from_record_id = airtable_mock
17-
1833 client = await aiohttp_client (bot )
19- await client .post ("/slack/actions" , data = action )
20- assert isinstance (slack_mock .call_args [0 ][1 ]["attachments" ], list )
34+ return client , slack_mock
0 commit comments