mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2025-01-01 08:56:27 +01:00
parent
6b7144bbab
commit
f267646828
3 changed files with 22 additions and 22 deletions
|
@ -64,10 +64,10 @@ class AudioTest(BaseTest, unittest.TestCase):
|
|||
audio = message.audio
|
||||
|
||||
self.assertTrue(isinstance(audio.file_id, str))
|
||||
self.assertNotEqual(audio.file_id, '')
|
||||
self.assertNotEqual(audio.file_id, None)
|
||||
# self.assertEqual(audio.duration, 4)
|
||||
self.assertEqual(audio.performer, '')
|
||||
self.assertEqual(audio.title, '')
|
||||
self.assertEqual(audio.performer, None)
|
||||
self.assertEqual(audio.title, None)
|
||||
self.assertEqual(audio.mime_type, self.mime_type)
|
||||
self.assertEqual(audio.file_size, self.file_size)
|
||||
|
||||
|
@ -89,7 +89,7 @@ class AudioTest(BaseTest, unittest.TestCase):
|
|||
audio = message.audio
|
||||
|
||||
self.assertTrue(isinstance(audio.file_id, str))
|
||||
self.assertNotEqual(audio.file_id, '')
|
||||
self.assertNotEqual(audio.file_id, None)
|
||||
self.assertEqual(audio.duration, self.duration)
|
||||
self.assertEqual(audio.performer, self.performer)
|
||||
self.assertEqual(audio.title, self.title)
|
||||
|
@ -112,7 +112,7 @@ class AudioTest(BaseTest, unittest.TestCase):
|
|||
audio = message.audio
|
||||
|
||||
self.assertTrue(isinstance(audio.file_id, str))
|
||||
self.assertNotEqual(audio.file_id, '')
|
||||
self.assertNotEqual(audio.file_id, None)
|
||||
self.assertEqual(audio.duration, self.duration)
|
||||
self.assertEqual(audio.performer, self.performer)
|
||||
self.assertEqual(audio.title, self.title)
|
||||
|
@ -136,7 +136,7 @@ class AudioTest(BaseTest, unittest.TestCase):
|
|||
audio = message.audio
|
||||
|
||||
self.assertTrue(isinstance(audio.file_id, str))
|
||||
self.assertNotEqual(audio.file_id, '')
|
||||
self.assertNotEqual(audio.file_id, None)
|
||||
self.assertEqual(audio.duration, self.duration)
|
||||
self.assertEqual(audio.performer, self.performer)
|
||||
self.assertEqual(audio.title, self.title)
|
||||
|
@ -152,7 +152,7 @@ class AudioTest(BaseTest, unittest.TestCase):
|
|||
audio = message.audio
|
||||
|
||||
self.assertTrue(isinstance(audio.file_id, str))
|
||||
self.assertNotEqual(audio.file_id, '')
|
||||
self.assertNotEqual(audio.file_id, None)
|
||||
self.assertEqual(audio.duration, self.duration)
|
||||
self.assertEqual(audio.mime_type, self.mime_type)
|
||||
self.assertEqual(audio.file_size, self.file_size)
|
||||
|
@ -171,7 +171,7 @@ class AudioTest(BaseTest, unittest.TestCase):
|
|||
audio = message.audio
|
||||
|
||||
self.assertTrue(isinstance(audio.file_id, str))
|
||||
self.assertNotEqual(audio.file_id, '')
|
||||
self.assertNotEqual(audio.file_id, None)
|
||||
self.assertEqual(audio.duration, self.duration)
|
||||
self.assertEqual(audio.mime_type, self.mime_type)
|
||||
self.assertEqual(audio.file_size, self.file_size)
|
||||
|
@ -266,7 +266,7 @@ class AudioTest(BaseTest, unittest.TestCase):
|
|||
message = self._bot.sendMessage(self._chat_id, '.')
|
||||
message = message.reply_audio(self.audio_file)
|
||||
|
||||
self.assertNotEqual(message.audio.file_id, '')
|
||||
self.assertNotEqual(message.audio.file_id, None)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
|
@ -422,7 +422,7 @@ class BotTest(BaseTest, unittest.TestCase):
|
|||
"""Tests if user is our trusty @PythonTelegramBot."""
|
||||
self.assertEqual(user.id, 133505823)
|
||||
self.assertEqual(user.first_name, 'PythonTelegramBot')
|
||||
self.assertEqual(user.last_name, '')
|
||||
self.assertEqual(user.last_name, None)
|
||||
self.assertEqual(user.username, 'PythonTelegramBot')
|
||||
self.assertEqual(user.name, '@PythonTelegramBot')
|
||||
|
||||
|
@ -432,7 +432,7 @@ class BotTest(BaseTest, unittest.TestCase):
|
|||
# tests the Bot.info decorator and associated funcs
|
||||
self.assertEqual(self._bot.id, 133505823)
|
||||
self.assertEqual(self._bot.first_name, 'PythonTelegramBot')
|
||||
self.assertEqual(self._bot.last_name, '')
|
||||
self.assertEqual(self._bot.last_name, None)
|
||||
self.assertEqual(self._bot.username, 'PythonTelegramBot')
|
||||
self.assertEqual(self._bot.name, '@PythonTelegramBot')
|
||||
|
||||
|
|
|
@ -76,12 +76,12 @@ class VideoTest(BaseTest, unittest.TestCase):
|
|||
video = message.video
|
||||
|
||||
self.assertTrue(isinstance(video.file_id, str))
|
||||
self.assertNotEqual(video.file_id, '')
|
||||
self.assertNotEqual(video.file_id, None)
|
||||
self.assertEqual(video.width, self.width)
|
||||
self.assertEqual(video.height, self.height)
|
||||
self.assertEqual(video.duration, self.duration)
|
||||
self.assertEqual(video.thumb, self.thumb)
|
||||
self.assertEqual(video.mime_type, '')
|
||||
self.assertEqual(video.mime_type, None)
|
||||
self.assertEqual(video.file_size, self.file_size)
|
||||
|
||||
@flaky(3, 1)
|
||||
|
@ -97,12 +97,12 @@ class VideoTest(BaseTest, unittest.TestCase):
|
|||
video = message.video
|
||||
|
||||
self.assertTrue(isinstance(video.file_id, str))
|
||||
self.assertNotEqual(video.file_id, '')
|
||||
self.assertNotEqual(video.file_id, None)
|
||||
self.assertEqual(video.width, self.width)
|
||||
self.assertEqual(video.height, self.height)
|
||||
self.assertEqual(video.duration, self.duration)
|
||||
self.assertEqual(video.thumb, self.thumb)
|
||||
self.assertEqual(video.mime_type, '')
|
||||
self.assertEqual(video.mime_type, None)
|
||||
self.assertEqual(video.file_size, self.file_size)
|
||||
|
||||
self.assertEqual(message.caption, self.caption)
|
||||
|
@ -120,12 +120,12 @@ class VideoTest(BaseTest, unittest.TestCase):
|
|||
video = message.video
|
||||
|
||||
self.assertTrue(isinstance(video.file_id, str))
|
||||
self.assertNotEqual(video.file_id, '')
|
||||
self.assertNotEqual(video.file_id, None)
|
||||
self.assertEqual(video.width, self.width)
|
||||
self.assertEqual(video.height, self.height)
|
||||
self.assertEqual(video.duration, self.duration)
|
||||
self.assertEqual(video.thumb, self.thumb)
|
||||
self.assertEqual(video.mime_type, '')
|
||||
self.assertEqual(video.mime_type, None)
|
||||
self.assertEqual(video.file_size, self.file_size)
|
||||
|
||||
self.assertEqual(message.caption, self.caption)
|
||||
|
@ -149,7 +149,7 @@ class VideoTest(BaseTest, unittest.TestCase):
|
|||
self.assertEqual(video.height, self.height)
|
||||
self.assertEqual(video.duration, self.duration)
|
||||
self.assertEqual(video.thumb, self.thumb)
|
||||
self.assertEqual(video.mime_type, '')
|
||||
self.assertEqual(video.mime_type, None)
|
||||
self.assertEqual(video.file_size, self.file_size)
|
||||
|
||||
self.assertEqual(message.caption, self.caption)
|
||||
|
@ -167,11 +167,11 @@ class VideoTest(BaseTest, unittest.TestCase):
|
|||
video = message.video
|
||||
|
||||
self.assertTrue(isinstance(video.file_id, str))
|
||||
self.assertNotEqual(video.file_id, '')
|
||||
self.assertNotEqual(video.file_id, None)
|
||||
self.assertEqual(video.height, self.height)
|
||||
self.assertEqual(video.duration, self.duration)
|
||||
self.assertEqual(video.thumb, self.thumb_from_url)
|
||||
self.assertEqual(video.mime_type, '')
|
||||
self.assertEqual(video.mime_type, None)
|
||||
self.assertEqual(video.file_size, self.file_size)
|
||||
|
||||
self.assertEqual(message.caption, self.caption)
|
||||
|
@ -191,7 +191,7 @@ class VideoTest(BaseTest, unittest.TestCase):
|
|||
self.assertEqual(video.file_id, self.video_file_id)
|
||||
self.assertEqual(video.duration, 0)
|
||||
self.assertEqual(video.thumb, None)
|
||||
self.assertEqual(video.mime_type, '')
|
||||
self.assertEqual(video.mime_type, None)
|
||||
|
||||
self.assertEqual(message.caption, self.caption)
|
||||
|
||||
|
@ -268,7 +268,7 @@ class VideoTest(BaseTest, unittest.TestCase):
|
|||
message = self._bot.sendMessage(self._chat_id, '.')
|
||||
message = message.reply_video(self.video_file)
|
||||
|
||||
self.assertNotEqual(message.video.file_id, '')
|
||||
self.assertNotEqual(message.video.file_id, None)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
Loading…
Reference in a new issue