|
From: Waseem D. <wd...@us...> - 2005-06-16 05:32:09
|
Update of /cvsroot/gmailagent/GA-libgmail2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17805 Modified Files: testlibgmail2.py Log Message: Added new "newline contact" test (fails with error right now, since we don't do the right thing.) Index: testlibgmail2.py =================================================================== RCS file: /cvsroot/gmailagent/GA-libgmail2/testlibgmail2.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** testlibgmail2.py 16 Jun 2005 05:09:05 -0000 1.5 --- testlibgmail2.py 16 Jun 2005 05:32:00 -0000 1.6 *************** *** 35,38 **** --- 35,63 ---- account.removeContact(contact) + + def test1_BasicAddContact(self): + """Create and retrieve an entry-level contact""" + name = 'John Smith' + email = 'joh...@gm...' + notes = 'I am average' + account.addContact(name, email, notes) + myContacts = account.getContacts() + contact = myContacts.getContactByName(name) + self.assertEqual(contact.getName(), name, "Returned name isn't the one we created initially") + self.assertEqual(contact.getEmail(), email, "Returned email isn't the one we created initially") + self.assertEqual(contact.getNotes(), notes, "Returned note isn't the one we created initially") + + def test2_AdvancedAddContact(): + """Create and retrieve a contact with a newline in the notes""" + name = 'W4533m' + email = 'fak...@gm...' + notes = 'Is\nawesome' + account.addContact(name, email, notes) + myContacts = account.getContacts() + contact = myContacts.getContactByName(name) + self.assertEqual(contact.getName(), name, "Returned name isn't the one we created initially") + self.assertEqual(contact.getEmail(), email, "Returned email isn't the one we created initially") + self.assertEqual(contact.getNotes(), notes, "Returned note isn't the one we created initially") + def test3_GmailContact(self): """Check that GmailContact equality and accessor methods work""" *************** *** 154,158 **** """ self.assertEqual(vcard, expectedVCard, "getVCard() didn't export what we expected for BillyJo") ! if __name__ == '__main__': #unittest.main() --- 179,183 ---- """ self.assertEqual(vcard, expectedVCard, "getVCard() didn't export what we expected for BillyJo") ! if __name__ == '__main__': #unittest.main() |