@@ -74,7 +74,7 @@ def test_expected_values(self):
7474
7575 @flaky (3 , 1 )
7676 @timeout (10 )
77- def test_sendphotoo_all_args (self ):
77+ def test_sendphoto_all_args (self ):
7878 message = self ._bot .sendPhoto (self ._chat_id , self .photo_file , caption = self .caption , disable_notification = False )
7979 thumb , photo = message .photo
8080
@@ -115,6 +115,38 @@ def test_send_photo_url_jpg_file(self):
115115 self .assertEqual (photo .height , self .photo .height )
116116 self .assertEqual (photo .file_size , self .photo .file_size )
117117
118+ @flaky (3 , 1 )
119+ @timeout (10 )
120+ def test_send_photo_url_png_file (self ):
121+ message = self ._bot .sendPhoto (
122+ photo = 'http://dummyimage.com/600x400/000/fff.png&text=telegram' , chat_id = self ._chat_id )
123+
124+ thumb , photo = message .photo
125+
126+ self .assertIsInstance (thumb , telegram .PhotoSize )
127+ self .assertIsInstance (thumb .file_id , str )
128+ self .assertNotEqual (thumb .file_id , '' )
129+
130+ self .assertIsInstance (photo , telegram .PhotoSize )
131+ self .assertIsInstance (photo .file_id , str )
132+ self .assertNotEqual (photo .file_id , '' )
133+
134+ @flaky (3 , 1 )
135+ @timeout (10 )
136+ def test_send_photo_url_gif_file (self ):
137+ message = self ._bot .sendPhoto (
138+ photo = 'http://dummyimage.com/600x400/000/fff.gif&text=telegram' , chat_id = self ._chat_id )
139+
140+ thumb , photo = message .photo
141+
142+ self .assertIsInstance (thumb , telegram .PhotoSize )
143+ self .assertIsInstance (thumb .file_id , str )
144+ self .assertNotEqual (thumb .file_id , '' )
145+
146+ self .assertIsInstance (photo , telegram .PhotoSize )
147+ self .assertIsInstance (photo .file_id , str )
148+ self .assertNotEqual (photo .file_id , '' )
149+
118150 @flaky (3 , 1 )
119151 @timeout (10 )
120152 def test_send_photo_bytesio_jpg_file (self ):
@@ -141,6 +173,20 @@ def test_send_photo_bytesio_jpg_file(self):
141173 self .assertEqual (photo .height , 1080 )
142174 self .assertEqual (photo .file_size , 30907 )
143175
176+ @flaky (3 , 1 )
177+ @timeout (10 )
178+ def test_silent_send_photo (self ):
179+ message = self ._bot .sendPhoto (photo = self .photo_file , chat_id = self ._chat_id , disable_notification = True )
180+ thumb , photo = message .photo
181+
182+ self .assertIsInstance (thumb , telegram .PhotoSize )
183+ self .assertIsInstance (thumb .file_id , str )
184+ self .assertNotEqual (thumb .file_id , '' )
185+
186+ self .assertIsInstance (photo , telegram .PhotoSize )
187+ self .assertIsInstance (photo .file_id , str )
188+ self .assertNotEqual (photo .file_id , '' )
189+
144190 @flaky (3 , 1 )
145191 @timeout (10 )
146192 def test_send_photo_resend (self ):
0 commit comments