@@ -190,3 +190,50 @@ async def test_uploading_file_with_token_param_async(self):
190190 file = upload ["file" ]["id" ],
191191 )
192192 self .assertIsNotNone (deletion )
193+
194+ def test_request_file_info_false (self ):
195+ client = self .sync_client
196+ upload = client .files_upload_v2 (
197+ channels = self .channel_id ,
198+ title = "Foo" ,
199+ filename = "foo.txt" ,
200+ content = "foo" ,
201+ )
202+ self .assertIsNotNone (upload )
203+ self .assertIsNotNone (upload .get ("files" )[0 ].get ("id" ))
204+ self .assertIsNotNone (upload .get ("files" )[0 ].get ("name" ))
205+
206+ upload = client .files_upload_v2 (
207+ channels = self .channel_id ,
208+ title = "Foo" ,
209+ filename = "foo.txt" ,
210+ content = "foo" ,
211+ request_file_info = False ,
212+ )
213+ self .assertIsNotNone (upload )
214+ self .assertIsNotNone (upload .get ("files" )[0 ].get ("id" ))
215+ self .assertIsNone (upload .get ("files" )[0 ].get ("name" ))
216+
217+ @async_test
218+ async def test_request_file_info_false_async (self ):
219+ client = self .async_client
220+ upload = await client .files_upload_v2 (
221+ channels = self .channel_id ,
222+ title = "Foo" ,
223+ filename = "foo.txt" ,
224+ content = "foo" ,
225+ )
226+ self .assertIsNotNone (upload )
227+ self .assertIsNotNone (upload .get ("files" )[0 ].get ("id" ))
228+ self .assertIsNotNone (upload .get ("files" )[0 ].get ("name" ))
229+
230+ upload = await client .files_upload_v2 (
231+ channels = self .channel_id ,
232+ title = "Foo" ,
233+ filename = "foo.txt" ,
234+ content = "foo" ,
235+ request_file_info = False ,
236+ )
237+ self .assertIsNotNone (upload )
238+ self .assertIsNotNone (upload .get ("files" )[0 ].get ("id" ))
239+ self .assertIsNone (upload .get ("files" )[0 ].get ("name" ))
0 commit comments