X Tutup
Skip to content

Commit 325d813

Browse files
committed
Adding input_message_content and reply_markup for existing inlinequery* tests.
1 parent f68b8c3 commit 325d813

File tree

4 files changed

+45
-1
lines changed

4 files changed

+45
-1
lines changed

tests/test_inlinequeryresultgif.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ def setUp(self):
4545
self.thumb_url = 'thumb url'
4646
self.title = 'title'
4747
self.caption = 'caption'
48+
self.input_message_content = telegram.InputTextMessageContent(
49+
'input_message_content')
50+
self.reply_markup = telegram.InlineKeyboardMarkup([[
51+
telegram.InlineKeyboardButton('reply_markup')]])
4852

4953
self.json_dict = {
5054
'type': self.type,
@@ -55,6 +59,8 @@ def setUp(self):
5559
'thumb_url': self.thumb_url,
5660
'title': self.title,
5761
'caption': self.caption,
62+
'input_message_content': self.input_message_content.to_dict(),
63+
'reply_markup': self.reply_markup.to_dict(),
5864
}
5965

6066
def test_gif_de_json(self):
@@ -68,6 +74,10 @@ def test_gif_de_json(self):
6874
self.assertEqual(gif.thumb_url, self.thumb_url)
6975
self.assertEqual(gif.title, self.title)
7076
self.assertEqual(gif.caption, self.caption)
77+
self.assertDictEqual(gif.input_message_content.to_dict(),
78+
self.input_message_content.to_dict())
79+
self.assertDictEqual(gif.reply_markup.to_dict(),
80+
self.reply_markup.to_dict())
7181

7282
def test_gif_to_json(self):
7383
gif = telegram.InlineQueryResultGif.de_json(self.json_dict)

tests/test_inlinequeryresultmpeg4gif.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ def setUp(self):
4545
self.thumb_url = 'thumb url'
4646
self.title = 'title'
4747
self.caption = 'caption'
48+
self.input_message_content = telegram.InputTextMessageContent(
49+
'input_message_content')
50+
self.reply_markup = telegram.InlineKeyboardMarkup([[
51+
telegram.InlineKeyboardButton('reply_markup')]])
4852

4953
self.json_dict = {
5054
'type': self.type,
@@ -55,6 +59,8 @@ def setUp(self):
5559
'thumb_url': self.thumb_url,
5660
'title': self.title,
5761
'caption': self.caption,
62+
'input_message_content': self.input_message_content.to_dict(),
63+
'reply_markup': self.reply_markup.to_dict(),
5864
}
5965

6066
def test_mpeg4_de_json(self):
@@ -68,6 +74,10 @@ def test_mpeg4_de_json(self):
6874
self.assertEqual(mpeg4.thumb_url, self.thumb_url)
6975
self.assertEqual(mpeg4.title, self.title)
7076
self.assertEqual(mpeg4.caption, self.caption)
77+
self.assertDictEqual(mpeg4.input_message_content.to_dict(),
78+
self.input_message_content.to_dict())
79+
self.assertDictEqual(mpeg4.reply_markup.to_dict(),
80+
self.reply_markup.to_dict())
7181

7282
def test_mpeg4_to_json(self):
7383
mpeg4 = telegram.InlineQueryResultMpeg4Gif.de_json(self.json_dict)
@@ -76,7 +86,8 @@ def test_mpeg4_to_json(self):
7686

7787
def test_mpeg4_to_dict(self):
7888
mpeg4 = \
79-
telegram.InlineQueryResultMpeg4Gif.de_json(self.json_dict).to_dict()
89+
telegram.InlineQueryResultMpeg4Gif.de_json(
90+
self.json_dict).to_dict()
8091

8192
self.assertTrue(self.is_dict(mpeg4))
8293
self.assertDictEqual(self.json_dict, mpeg4)

tests/test_inlinequeryresultphoto.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,12 @@ def setUp(self):
4444
self.photo_height = 15
4545
self.thumb_url = 'thumb url'
4646
self.title = 'title'
47+
self.description = 'description'
4748
self.caption = 'caption'
49+
self.input_message_content = telegram.InputTextMessageContent(
50+
'input_message_content')
51+
self.reply_markup = telegram.InlineKeyboardMarkup([[
52+
telegram.InlineKeyboardButton('reply_markup')]])
4853

4954
self.json_dict = {
5055
'type': self.type,
@@ -54,7 +59,10 @@ def setUp(self):
5459
'photo_height': self.photo_height,
5560
'thumb_url': self.thumb_url,
5661
'title': self.title,
62+
'description': self.description,
5763
'caption': self.caption,
64+
'input_message_content': self.input_message_content.to_dict(),
65+
'reply_markup': self.reply_markup.to_dict(),
5866
}
5967

6068
def test_photo_de_json(self):
@@ -67,7 +75,12 @@ def test_photo_de_json(self):
6775
self.assertEqual(photo.photo_height, self.photo_height)
6876
self.assertEqual(photo.thumb_url, self.thumb_url)
6977
self.assertEqual(photo.title, self.title)
78+
self.assertEqual(photo.description, self.description)
7079
self.assertEqual(photo.caption, self.caption)
80+
self.assertDictEqual(photo.input_message_content.to_dict(),
81+
self.input_message_content.to_dict())
82+
self.assertDictEqual(photo.reply_markup.to_dict(),
83+
self.reply_markup.to_dict())
7184

7285
def test_photo_to_json(self):
7386
photo = telegram.InlineQueryResultPhoto.de_json(self.json_dict)

tests/test_inlinequeryresultvideo.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ def setUp(self):
4848
self.title = 'title'
4949
self.caption = 'caption'
5050
self.description = 'description'
51+
self.input_message_content = telegram.InputTextMessageContent(
52+
'input_message_content')
53+
self.reply_markup = telegram.InlineKeyboardMarkup([[
54+
telegram.InlineKeyboardButton('reply_markup')]])
5155

5256
self.json_dict = {
5357
'type': self.type,
@@ -61,6 +65,8 @@ def setUp(self):
6165
'title': self.title,
6266
'caption': self.caption,
6367
'description': self.description,
68+
'input_message_content': self.input_message_content.to_dict(),
69+
'reply_markup': self.reply_markup.to_dict(),
6470
}
6571

6672
def test_video_de_json(self):
@@ -77,6 +83,10 @@ def test_video_de_json(self):
7783
self.assertEqual(video.title, self.title)
7884
self.assertEqual(video.description, self.description)
7985
self.assertEqual(video.caption, self.caption)
86+
self.assertDictEqual(video.input_message_content.to_dict(),
87+
self.input_message_content.to_dict())
88+
self.assertDictEqual(video.reply_markup.to_dict(),
89+
self.reply_markup.to_dict())
8090

8191
def test_video_to_json(self):
8292
video = telegram.InlineQueryResultVideo.de_json(self.json_dict)

0 commit comments

Comments
 (0)
X Tutup