Exemple #1
0
    def test_successful_removal(self):
        # Setup
        contact_list             = ContactList(nicks=['Alice', 'Bob'])
        contact                  = contact_list.get_contact_by_address_or_nick("Bob")
        group_list               = GroupList(groups=['test_group', 'test_group2'])
        key_list                 = KeyList(nicks=['Alice', 'Bob'])
        self.window_list.windows = [RxWindow(type=WIN_TYPE_GROUP)]

        # Test
        self.assert_fr("No log database available.",
                       contact_rem, *self.args, contact_list, group_list, key_list, self.settings, self.master_key)
        self.assertFalse(contact_list.has_pub_key(nick_to_pub_key("Bob")))
        self.assertFalse(key_list.has_keyset(nick_to_pub_key("Bob")))
        for g in group_list:
            self.assertFalse(contact in g.members)
Exemple #2
0
    def test_successful_removal(self):
        # Setup
        contact_list = ContactList(nicks=['Alice', 'Bob'])
        contact = contact_list.get_contact('*****@*****.**')
        group_list = GroupList(groups=['testgroup', 'testgroup2'])
        key_list = KeyList(nicks=['Alice', 'Bob'])
        self.window_list.windows = [RxWindow(type=WIN_TYPE_GROUP)]

        # Test
        self.assertIsNone(
            remove_contact(self.cmd_data, self.ts, self.window_list,
                           contact_list, group_list, key_list))
        self.assertFalse(contact_list.has_contact('*****@*****.**'))
        self.assertFalse(key_list.has_keyset('*****@*****.**'))
        for g in group_list:
            self.assertFalse(contact in g.members)
Exemple #3
0
    def test_successful_removal(self):
        # Setup
        cmd_data = b'*****@*****.**'
        ts = datetime.datetime.now()
        contact_list = ContactList(nicks=['Alice', 'Bob'])
        contact = contact_list.get_contact('*****@*****.**')
        group_list = GroupList(groups=['testgroup', 'testgroup2'])
        key_list = KeyList(nicks=['Alice', 'Bob'])
        window_list = WindowList()

        # Test
        self.assertIsNone(
            remove_contact(cmd_data, ts, window_list, contact_list, group_list,
                           key_list))
        self.assertFalse(contact_list.has_contact('*****@*****.**'))
        self.assertFalse(key_list.has_keyset('*****@*****.**'))
        for g in group_list:
            self.assertFalse(contact in g.members)