def test_parse_entity(self): text = (b'\\U0001f469\\u200d\\U0001f469\\u200d\\U0001f467' b'\\u200d\\U0001f467\\U0001f431http://google.com' ).decode('unicode-escape') entity = telegram.MessageEntity(type=telegram.MessageEntity.URL, offset=13, length=17) game = telegram.Game(self.title, self.description, self.photo, text=text, text_entities=[entity]) self.assertEqual(game.parse_text_entity(entity), 'http://google.com')
def test_game_all_args(self): game = telegram.Game(title=self.title, description=self.description, photo=self.photo, text=self.text, text_entities=self.text_entities, animation=self.animation) self.assertEqual(game.title, self.title) self.assertEqual(game.description, self.description) self.assertEqual(game.photo, self.photo) self.assertEqual(game.text, self.text) self.assertEqual(game.text_entities, self.text_entities) self.assertEqual(game.animation, self.animation)