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

Method test_sync

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

Source from the content-addressed store, hash-verified

23 pass
24
25 def test_sync(self):
26 client = self.sync_client
27 user_id = list(
28 filter(
29 lambda u: not u["deleted"] and "bot_id" not in u,
30 client.users_list(limit=50)["members"],
31 )
32 )[
33 0
34 ]["id"]
35
36 new_call = client.calls_add(
37 external_unique_id=str(uuid.uuid4()),
38 join_url="https://www.example.com/calls/12345",
39 users=[
40 {"slack_id": user_id},
41 {
42 "external_id": "anon-111",
43 "avatar_url": "https://assets.brandfolder.com/pmix53-32t4so-a6439g/original/slackbot.png",
44 "display_name": "anonymous user 1",
45 },
46 ],
47 )
48 self.assertIsNotNone(new_call)
49 call_id = new_call["call"]["id"]
50
51 channel_message = client.chat_postMessage(
52 channel="#random",
53 blocks=[
54 {
55 "type": "call",
56 "call_id": call_id,
57 }
58 ],
59 )
60 self.assertIsNotNone(channel_message)
61
62 channel_message = client.chat_postMessage(channel="#random", blocks=[CallBlock(call_id=call_id)])
63 self.assertIsNotNone(channel_message)
64
65 call_info = client.calls_info(id=call_id)
66 self.assertIsNotNone(call_info)
67
68 new_participants = client.calls_participants_add(
69 id=call_id,
70 users=[
71 {
72 "external_id": "anon-222",
73 "avatar_url": "https://assets.brandfolder.com/pmix53-32t4so-a6439g/original/slackbot.png",
74 "display_name": "anonymous user 2",
75 }
76 ],
77 )
78 self.assertIsNotNone(new_participants)
79
80 participants_removal = client.calls_participants_remove(
81 id=call_id,
82 users=[

Callers

nothing calls this directly

Calls 9

CallBlockClass · 0.90
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