@@ -44,6 +44,8 @@ def test_uploading_text_files(self):
4444 title = "Test code" ,
4545 )
4646 self .assertIsNotNone (upload )
47+ self .assertIsNotNone (upload .get ("files" )[0 ].get ("id" ))
48+ self .assertIsNotNone (upload .get ("files" )[0 ].get ("title" ))
4749
4850 def test_uploading_bytes_io (self ):
4951 client = self .sync_client
@@ -54,6 +56,8 @@ def test_uploading_bytes_io(self):
5456 title = "Test code" ,
5557 )
5658 self .assertIsNotNone (upload )
59+ self .assertIsNotNone (upload .get ("files" )[0 ].get ("id" ))
60+ self .assertIsNotNone (upload .get ("files" )[0 ].get ("title" ))
5761
5862 def test_uploading_multiple_files (self ):
5963 client = self .sync_client
@@ -74,6 +78,8 @@ def test_uploading_multiple_files(self):
7478 initial_comment = "Here are files :wave:" ,
7579 )
7680 self .assertIsNotNone (upload )
81+ self .assertIsNotNone (upload .get ("files" )[0 ].get ("id" ))
82+ self .assertIsNotNone (upload .get ("files" )[0 ].get ("title" ))
7783
7884 @async_test
7985 async def test_uploading_text_files_async (self ):
@@ -86,6 +92,8 @@ async def test_uploading_text_files_async(self):
8692 file = file ,
8793 )
8894 self .assertIsNotNone (upload )
95+ self .assertIsNotNone (upload .get ("files" )[0 ].get ("id" ))
96+ self .assertIsNotNone (upload .get ("files" )[0 ].get ("title" ))
8997
9098 deletion = await client .files_delete (file = upload ["file" ]["id" ])
9199 self .assertIsNotNone (deletion )
@@ -116,6 +124,8 @@ def test_uploading_binary_files(self):
116124 file = file ,
117125 )
118126 self .assertIsNotNone (upload )
127+ self .assertIsNotNone (upload .get ("files" )[0 ].get ("id" ))
128+ self .assertIsNotNone (upload .get ("files" )[0 ].get ("title" ))
119129
120130 deletion = client .files_delete (file = upload ["file" ]["id" ])
121131 self .assertIsNotNone (deletion )
@@ -133,6 +143,8 @@ def test_uploading_binary_files_as_content(self):
133143 content = content ,
134144 )
135145 self .assertIsNotNone (upload )
146+ self .assertIsNotNone (upload .get ("files" )[0 ].get ("id" ))
147+ self .assertIsNotNone (upload .get ("files" )[0 ].get ("title" ))
136148
137149 deletion = client .files_delete (file = upload ["file" ]["id" ])
138150 self .assertIsNotNone (deletion )
@@ -149,6 +161,8 @@ async def test_uploading_binary_files_async(self):
149161 file = file ,
150162 )
151163 self .assertIsNotNone (upload )
164+ self .assertIsNotNone (upload .get ("files" )[0 ].get ("id" ))
165+ self .assertIsNotNone (upload .get ("files" )[0 ].get ("title" ))
152166
153167 deletion = await client .files_delete (file = upload ["file" ]["id" ])
154168 self .assertIsNotNone (deletion )
@@ -165,6 +179,8 @@ def test_uploading_file_with_token_param(self):
165179 file = file ,
166180 )
167181 self .assertIsNotNone (upload )
182+ self .assertIsNotNone (upload .get ("files" )[0 ].get ("id" ))
183+ self .assertIsNotNone (upload .get ("files" )[0 ].get ("title" ))
168184
169185 deletion = client .files_delete (
170186 token = self .bot_token ,
@@ -185,56 +201,11 @@ async def test_uploading_file_with_token_param_async(self):
185201 file = file ,
186202 )
187203 self .assertIsNotNone (upload )
204+ self .assertIsNotNone (upload .get ("files" )[0 ].get ("id" ))
205+ self .assertIsNotNone (upload .get ("files" )[0 ].get ("title" ))
188206
189207 deletion = await client .files_delete (
190208 token = self .bot_token ,
191209 file = upload ["file" ]["id" ],
192210 )
193211 self .assertIsNotNone (deletion )
194-
195- def test_request_file_info_false (self ):
196- client = self .sync_client
197- upload = client .files_upload_v2 (
198- channels = self .channel_id ,
199- title = "Foo" ,
200- filename = "foo.txt" ,
201- content = "foo" ,
202- )
203- self .assertIsNotNone (upload )
204- self .assertIsNotNone (upload .get ("files" )[0 ].get ("id" ))
205- self .assertIsNotNone (upload .get ("files" )[0 ].get ("name" ))
206-
207- upload = client .files_upload_v2 (
208- channels = self .channel_id ,
209- title = "Foo" ,
210- filename = "foo.txt" ,
211- content = "foo" ,
212- request_file_info = False ,
213- )
214- self .assertIsNotNone (upload )
215- self .assertIsNotNone (upload .get ("files" )[0 ].get ("id" ))
216- self .assertIsNone (upload .get ("files" )[0 ].get ("name" ))
217-
218- @async_test
219- async def test_request_file_info_false_async (self ):
220- client = self .async_client
221- upload = await client .files_upload_v2 (
222- channels = self .channel_id ,
223- title = "Foo" ,
224- filename = "foo.txt" ,
225- content = "foo" ,
226- )
227- self .assertIsNotNone (upload )
228- self .assertIsNotNone (upload .get ("files" )[0 ].get ("id" ))
229- self .assertIsNotNone (upload .get ("files" )[0 ].get ("name" ))
230-
231- upload = await client .files_upload_v2 (
232- channels = self .channel_id ,
233- title = "Foo" ,
234- filename = "foo.txt" ,
235- content = "foo" ,
236- request_file_info = False ,
237- )
238- self .assertIsNotNone (upload )
239- self .assertIsNotNone (upload .get ("files" )[0 ].get ("id" ))
240- self .assertIsNone (upload .get ("files" )[0 ].get ("name" ))
0 commit comments