Trying to isolate the problem.

This commit is contained in:
Leandro Toledo 2016-04-23 22:37:59 -03:00
parent 6390b7fd9b
commit fe06708d34
2 changed files with 25 additions and 25 deletions

View file

@ -47,11 +47,11 @@ class Venue(TelegramObject):
@staticmethod
def de_json(data):
data = super(Venue, Venue).de_json(data)
if not data:
return None
data = super(Venue, Venue).de_json(data)
data['location'] = Location.de_json(data.get('location'))
return Venue(**data)

View file

@ -66,29 +66,29 @@ class InlineQueryResultVenueTest(BaseTest, unittest.TestCase):
'reply_markup': self.reply_markup.to_dict(),
}
# def test_venue_de_json(self):
# venue = telegram.InlineQueryResultVenue.de_json(self.json_dict)
#
# self.assertEqual(venue.id, self.id)
# self.assertEqual(venue.type, self.type)
# self.assertEqual(venue.latitude, self.latitude)
# self.assertEqual(venue.longitude, self.longitude)
# self.assertEqual(venue.title, self.title)
# self.assertEqual(venue.address, self.address)
# self.assertEqual(venue.foursquare_id, self.foursquare_id)
# self.assertEqual(venue.thumb_url, self.thumb_url)
# self.assertEqual(venue.thumb_width, self.thumb_width)
# self.assertEqual(venue.thumb_height, self.thumb_height)
# self.assertDictEqual(venue.input_message_content.to_dict(),
# self.input_message_content.to_dict())
# self.assertDictEqual(venue.reply_markup.to_dict(),
# self.reply_markup.to_dict())
#
# def test_venue_to_json(self):
# venue = telegram.InlineQueryResultVenue.de_json(self.json_dict)
#
# self.assertTrue(self.is_json(venue.to_json()))
#
def test_venue_de_json(self):
venue = telegram.InlineQueryResultVenue.de_json(self.json_dict)
self.assertEqual(venue.id, self.id)
self.assertEqual(venue.type, self.type)
self.assertEqual(venue.latitude, self.latitude)
self.assertEqual(venue.longitude, self.longitude)
self.assertEqual(venue.title, self.title)
self.assertEqual(venue.address, self.address)
self.assertEqual(venue.foursquare_id, self.foursquare_id)
self.assertEqual(venue.thumb_url, self.thumb_url)
self.assertEqual(venue.thumb_width, self.thumb_width)
self.assertEqual(venue.thumb_height, self.thumb_height)
self.assertDictEqual(venue.input_message_content.to_dict(),
self.input_message_content.to_dict())
self.assertDictEqual(venue.reply_markup.to_dict(),
self.reply_markup.to_dict())
def test_venue_to_json(self):
venue = telegram.InlineQueryResultVenue.de_json(self.json_dict)
self.assertTrue(self.is_json(venue.to_json()))
# def test_venue_to_dict(self):
# venue = \
# telegram.InlineQueryResultVenue.de_json(