def test_set_nonexistant_field(self): entry = address.entry.Entry() with self.assertRaises(KeyError): entry.set_attr("undefined", "value")
def test_change_field_value(self): entry = address.entry.Entry("William") self.assertEquals(entry.get_attr(address.entry.FNAME), "William") entry.set_attr(address.entry.FNAME, "Bill") self.assertEquals(entry.get_attr(address.entry.FNAME), "Bill")