예제 #1
0
 def test_can_modify_contact_name(self):
     contact = Contact("Marvin Goodwright")
     contact.name("Albus Dumbledore")
     self.assertEqual(contact._name, "Albus Dumbledore")
예제 #2
0
 def test_can_only_set_contact_name_to_str(self):
     contact = Contact("Marvin Goodwright")
     with self.assertRaises(TypeError):
         contact.name(123)
예제 #3
0
 def test_contact_name_property(self):
     contact = Contact("Marvin Goodwright")
     self.assertIs(contact._name, contact.name())