예제 #1
0
def test_contact_exists(self):
    self.new_contact.save_contact()
    test_contact = Contact("Test", "user", "071234678",
                           "*****@*****.**")  #new contact
    test_contact.save_contact()
    contact_exists = Contact.contact_exists("0712345678")
    self.assertTrue(contact_exists)
예제 #2
0
 def setUp(self):
     self.new_contact = Contact("John", "Doe", "0749319133",
                                "*****@*****.**")  #create contact object
예제 #3
0
def test_find_contact_by_number(self):
    self.new_contact.save_contact()
    test_contact = Contact("Test", "user", "0712345678", "*****@*****.**")
    test_contact.save_contact()
    found_contact = Contact.find_by_number("0712345678")
    self.assertEqual(found_contact.email, test_contact.email)
예제 #4
0
def test_delete_contact(self):
    self.new_contact.save_contact()
    test_contact = Contact("Test", "user", "0712345678", "*****@*****.**")
    test_contact.save_contact()
    self.new_contact.delete_contact()
    self.assertEqual(len(Contact.contact_list), 1)
예제 #5
0
def test_save_multiple_contact(
        self):  #checks if one can save multiple contacts
    self.new_contact.save_contact()
    test_contact = Contact("Test", "user", "0712345678", "*****@*****.**")
    test_contact.save_contact()
    self.assertEqual(len(Contact.contact_list), 2)
예제 #6
0
def create_contact(fname, lname, phone, email):
    new_contact = Contact(fname, lname, phone, email)
    return new_contact
예제 #7
0
def display_contacts():
    return Contact.display_contacts()
예제 #8
0
def check_existing_contacts(number):
    return Contact.contact_exist(number)
예제 #9
0
def find_contact(number):
    return Contact.find_by_number(number)