def test_de_json(self, bot): name = 'test_by_{0}'.format(bot.username) json_dict = { 'name': name, 'title': self.title, 'contains_masks': self.contains_masks, 'stickers': [x.to_dict() for x in self.stickers] } sticker_set = StickerSet.de_json(json_dict, bot) assert sticker_set.name == name assert sticker_set.title == self.title assert sticker_set.contains_masks == self.contains_masks assert sticker_set.stickers == self.stickers
def test_de_json(self, bot, sticker): name = f'test_by_{bot.username}' json_dict = { 'name': name, 'title': self.title, 'is_animated': self.is_animated, 'contains_masks': self.contains_masks, 'stickers': [x.to_dict() for x in self.stickers], 'thumb': sticker.thumb.to_dict(), } sticker_set = StickerSet.de_json(json_dict, bot) assert sticker_set.name == name assert sticker_set.title == self.title assert sticker_set.is_animated == self.is_animated assert sticker_set.contains_masks == self.contains_masks assert sticker_set.stickers == self.stickers assert sticker_set.thumb == sticker.thumb
def test_de_json(self, bot, sticker): name = f"test_by_{bot.username}" json_dict = { "name": name, "title": self.title, "is_animated": self.is_animated, "is_video": self.is_video, "contains_masks": self.contains_masks, "stickers": [x.to_dict() for x in self.stickers], "thumb": sticker.thumb.to_dict(), } sticker_set = StickerSet.de_json(json_dict, bot) assert sticker_set.name == name assert sticker_set.title == self.title assert sticker_set.is_animated == self.is_animated assert sticker_set.is_video == self.is_video assert sticker_set.contains_masks == self.contains_masks assert sticker_set.stickers == self.stickers assert sticker_set.thumb == sticker.thumb