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")
def test_get_nonexistant_field(self): entry = address.entry.Entry() with self.assertRaises(KeyError): self.assertEquals(entry.get_attr("undefined"))
def test_get_unset_mandatory_field(self): entry = address.entry.Entry() self.assertEquals(entry.get_attr(address.entry.FNAME), "")
def test_get_first_name(self): entry = address.entry.Entry("William") self.assertEquals(entry.get_attr(address.entry.FNAME), "William")