def testUserRemovedMe(self): self.client.factory.contacts = msn.MSNContactList() contact = msn.MSNContact(userHandle='*****@*****.**') contact.addToList(msn.REVERSE_LIST) self.client.factory.contacts.addContact(contact) self.client.lineReceived("REM 0 RL 100 [email protected]") self.failUnless(self.client.state == 'USERREMOVEDME', "Failed to remove user from reverse list")
def testAsyncPhoneChange(self): c = msn.MSNContact(userHandle='*****@*****.**') self.client.factory.contacts = msn.MSNContactList() self.client.factory.contacts.addContact(c) self.client.makeConnection(StringTransport()) self.client.lineReceived("BPR 101 [email protected] PHH 123%20456") c = self.client.factory.contacts.getContact('*****@*****.**') self.failUnless(self.client.state == 'GOTPHONE', "Did not fire phone change callback") self.failUnless(c.homePhone == '123 456', "Did not update the contact's phone number") self.failUnless(self.client.factory.contacts.version == 101, "Did not update list version")