MCPcopy Create free account
hub / github.com/slackapi/python-slack-sdk / test_async

Method test_async

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

Source from the content-addressed store, hash-verified

94
95 @async_test
96 async def test_async(self):
97 client = self.async_client
98
99 # Channel canvas
100 new_channel = await client.conversations_create(name=f"test-{str(time.time()).replace('.', '-')}")
101 channel_id = new_channel["channel"]["id"]
102 channel_canvas = await client.conversations_canvases_create(
103 channel_id=channel_id,
104 document_content={
105 "type": "markdown",
106 "markdown": """# My canvas
107
108## Hey
109
110What's up?
111
112- foo
113- bar
114""",
115 },
116 )
117 self.assertIsNone(channel_canvas.get("error"))
118
119 # Standalone canvas
120 standalone_canvas = await client.canvases_create(
121 title="My canvas",
122 document_content={
123 "type": "markdown",
124 "markdown": """# My canvas
125
126## Hey
127
128What's up?
129
130- foo
131- bar
132""",
133 },
134 )
135 self.assertIsNone(standalone_canvas.get("error"))
136 canvas_id = standalone_canvas.get("canvas_id")
137
138 sections = await client.canvases_sections_lookup(canvas_id=canvas_id, criteria={"contains_text": "Hey"})
139 section_id = sections["sections"][0]["id"]
140
141 edit = await client.canvases_edit(
142 canvas_id=canvas_id,
143 changes=[
144 {
145 "operation": "replace",
146 "section_id": section_id,
147 "document_content": {"type": "markdown", "markdown": "## Hey Hey"},
148 }
149 ],
150 )
151 self.assertIsNone(edit.get("error"))
152
153 user_id = (await client.auth_test())["user_id"]

Callers

nothing calls this directly

Calls 10

conversations_createMethod · 0.45
getMethod · 0.45
canvases_createMethod · 0.45
canvases_editMethod · 0.45
auth_testMethod · 0.45
canvases_access_setMethod · 0.45
canvases_deleteMethod · 0.45

Tested by

no test coverage detected