MCPcopy Index your code
hub / github.com/slackapi/python-slack-sdk / test_async

Method test_async

integration_tests/web/test_calls.py:99–149  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

97
98 @async_test
99 async def test_async(self):
100 client = self.async_client
101 users = await client.users_list(limit=50)
102 user_id = list(filter(lambda u: not u["deleted"] and "bot_id" not in u, users["members"]))[0]["id"]
103
104 new_call = await client.calls_add(
105 external_unique_id=str(uuid.uuid4()),
106 join_url="https://www.example.com/calls/12345",
107 users=[
108 {"slack_id": user_id},
109 {
110 "external_id": "anon-111",
111 "avatar_url": "https://assets.brandfolder.com/pmix53-32t4so-a6439g/original/slackbot.png",
112 "display_name": "anonymous user 1",
113 },
114 ],
115 )
116 self.assertIsNotNone(new_call)
117 call_id = new_call["call"]["id"]
118
119 channel_message = await client.chat_postMessage(
120 channel="#random",
121 blocks=[
122 {
123 "type": "call",
124 "call_id": call_id,
125 }
126 ],
127 )
128 self.assertIsNotNone(channel_message)
129
130 call_info = await client.calls_info(id=call_id)
131 self.assertIsNotNone(call_info)
132
133 new_participants = await client.calls_participants_add(
134 id=call_id,
135 users=[
136 {
137 "external_id": "anon-222",
138 "avatar_url": "https://assets.brandfolder.com/pmix53-32t4so-a6439g/original/slackbot.png",
139 "display_name": "anonymous user 2",
140 }
141 ],
142 )
143 self.assertIsNotNone(new_participants)
144
145 modified_call = await client.calls_update(id=call_id, join_url="https://www.example.com/calls/99999")
146 self.assertIsNotNone(modified_call)
147
148 ended_call = await client.calls_end(id=call_id)
149 self.assertIsNotNone(ended_call)

Callers

nothing calls this directly

Calls 7

users_listMethod · 0.45
calls_addMethod · 0.45
chat_postMessageMethod · 0.45
calls_infoMethod · 0.45
calls_updateMethod · 0.45
calls_endMethod · 0.45

Tested by

no test coverage detected