Skip to content

Commit

Permalink
Adding test to check if thumbs are PhotoSize instances
Browse files Browse the repository at this point in the history
  • Loading branch information
leandrotoledo committed Sep 4, 2015
1 parent 49ff02d commit 79cdb6c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/test_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ def testSendDocument(self):

self.assertTrue(self.is_json(message.to_json()))
self.assertEqual(message.document.file_size, 12948)
self.assertTrue(isinstance(message.document.thumb, telegram.PhotoSize))

def testSendGIFURLDocument(self):
'''Test the telegram.Bot sendDocument method'''
Expand All @@ -203,6 +204,7 @@ def testResendDocument(self):

self.assertTrue(self.is_json(message.to_json()))
self.assertEqual(message.document.file_id, 'BQADAQADHAADNTwtBxZxUGKyxYbYAg')
self.assertTrue(isinstance(message.document.thumb, telegram.PhotoSize))

def testSendVideo(self):
'''Test the telegram.Bot sendVideo method'''
Expand All @@ -214,6 +216,8 @@ def testSendVideo(self):
self.assertTrue(self.is_json(message.to_json()))
self.assertEqual(message.video.file_size, 326534)
self.assertEqual(message.caption, 'testSendVideo')
if message.video.thumb:
self.assertTrue(isinstance(message.video.thumb, telegram.PhotoSize))

def testResendVideo(self):
'''Test the telegram.Bot sendVideo method'''
Expand All @@ -223,6 +227,7 @@ def testResendVideo(self):

self.assertTrue(self.is_json(message.to_json()))
self.assertEqual(message.video.duration, 4)
self.assertTrue(isinstance(message.video.thumb, telegram.PhotoSize))

def testResendSticker(self):
'''Test the telegram.Bot sendSticker method'''
Expand All @@ -232,6 +237,7 @@ def testResendSticker(self):

self.assertTrue(self.is_json(message.to_json()))
self.assertEqual(message.sticker.file_size, 39518)
self.assertTrue(isinstance(message.sticker.thumb, telegram.PhotoSize))

def testSendLocation(self):
'''Test the telegram.Bot sendLocation method'''
Expand Down

0 comments on commit 79cdb6c

Please sign in to comment.