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 [email protected]") self.failUnless(self.client.state == 'USERREMOVEDME', "Failed to remove user from reverse list")
def testRemContactAL(self): self.client.factory.contacts = msn.MSNContactList() self.client.factory.contacts.addContact( msn.MSNContact(userGuid="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", userHandle="*****@*****.**", screenName="Some guy", lists=msn.ALLOW_LIST)) self.client.doRemContactAL() self.failUnless(self.loop.doSteps(10), 'Failed to disconnect') self.failUnless((self.client.test == 'PASS'), 'Failed to remove contact from allow list')
def testAsyncPhoneChange(self): c = msn.MSNContact(userHandle='*****@*****.**') self.client.factory.contacts = msn.MSNContactList() self.client.factory.contacts.addContact(c) self.client.makeConnection(StringIOWithoutClosing()) 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")
def testAddContactAL(self): self.client.factory.contacts = msn.MSNContactList() self.client.doAddContactAL() self.failUnless(self.loop.doSteps(10), 'Failed to disconnect') self.failUnless((self.client.test == 'PASS'), 'Failed to add contact to allow list')
def testSetPrivacyMode(self): self.client.factory.contacts = msn.MSNContactList() self.client.doPrivacyMode() self.failUnless(self.loop.doSteps(10), 'Failed to disconnect') self.failUnless((self.client.test == 'PASS'), 'Failed to change privacy mode')
def testUserAddedMe(self): self.client.factory.contacts = msn.MSNContactList() self.client.lineReceived("ADC 0 RL [email protected] F=Screen%20Name") self.failUnless(self.client.state == 'USERADDEDME', "Failed to add user to reverse lise")