Beispiel #1
0
    def test_successful_group_add(self, _: Any) -> None:
        # Setup
        self.configure_groups(no_contacts=51)
        self.group.members = self.contact_list.contacts[:49]

        # Test
        self.assertIsNone(group_add_member('test_group', [nick_to_pub_key("49")], self.contact_list,
                                           self.group_list, self.settings, self.queues, self.master_key))
        group2 = self.group_list.get_group('test_group')
        self.assertEqual(len(group2), 50)

        for c in group2:
            self.assertIsInstance(c, Contact)

        self.assertEqual(self.queues[COMMAND_PACKET_QUEUE].qsize(), 1)
        self.assertEqual(self.queues[RELAY_PACKET_QUEUE].qsize(), 1)
Beispiel #2
0
 def test_new_group_is_created_if_specified_group_does_not_exist_and_user_chooses_yes(
         self, _):
     self.assertIsNone(group_add_member('test_group', [], *self.args))
     self.assertEqual(self.queues[COMMAND_PACKET_QUEUE].qsize(), 1)
     self.assertEqual(self.queues[RELAY_PACKET_QUEUE].qsize(), 0)