X Tutup
Skip to content

Commit 976f340

Browse files
committed
Add possibly good-enough test for all_members_are_admin
Should be good enough... If we /really/ wanted to we could get two different chats from telegram and check them, but it really shouldn't be necessary.
1 parent 6b77885 commit 976f340

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tests/test_chat.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,12 @@ def setUp(self):
3636
self.id = -28767330
3737
self.title = 'ToledosPalaceBot - Group'
3838
self.type = 'group'
39+
self.all_members_are_admins = False
3940

40-
self.json_dict = {'id': self.id, 'title': self.title, 'type': self.type}
41+
self.json_dict = {'id': self.id,
42+
'title': self.title,
43+
'type': self.type,
44+
'all_members_are_admins': self.all_members_are_admins}
4145

4246
def test_group_chat_de_json_empty_json(self):
4347
group_chat = telegram.Chat.de_json({}, self._bot)
@@ -50,6 +54,7 @@ def test_group_chat_de_json(self):
5054
self.assertEqual(group_chat.id, self.id)
5155
self.assertEqual(group_chat.title, self.title)
5256
self.assertEqual(group_chat.type, self.type)
57+
self.assertEqual(group_chat.all_members_are_admins, self.all_members_are_admins)
5358

5459
def test_group_chat_to_json(self):
5560
group_chat = telegram.Chat.de_json(self.json_dict, self._bot)
@@ -63,6 +68,7 @@ def test_group_chat_to_dict(self):
6368
self.assertEqual(group_chat['id'], self.id)
6469
self.assertEqual(group_chat['title'], self.title)
6570
self.assertEqual(group_chat['type'], self.type)
71+
self.assertEqual(group_chat['all_members_are_admins'], self.all_members_are_admins)
6672

6773
@flaky(3, 1)
6874
def test_send_action(self):

0 commit comments

Comments
 (0)
X Tutup