From f2676468282b4dcbce37d837e05392f14082b991 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jannes=20H=C3=B6ke?= Date: Mon, 27 Feb 2017 15:23:48 +0100 Subject: [PATCH] :white_check_mark: Fix tests #494 --- tests/test_audio.py | 18 +++++++++--------- tests/test_bot.py | 4 ++-- tests/test_video.py | 22 +++++++++++----------- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/tests/test_audio.py b/tests/test_audio.py index 73cf25dd4..fecae698c 100644 --- a/tests/test_audio.py +++ b/tests/test_audio.py @@ -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__': diff --git a/tests/test_bot.py b/tests/test_bot.py index f5a3a8411..d92348c55 100644 --- a/tests/test_bot.py +++ b/tests/test_bot.py @@ -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') diff --git a/tests/test_video.py b/tests/test_video.py index 0fcd0c3d2..facd8d263 100644 --- a/tests/test_video.py +++ b/tests/test_video.py @@ -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__':