示例#1
0
 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")
示例#2
0
 def test_get_nonexistant_field(self):
     entry = address.entry.Entry()
     with self.assertRaises(KeyError):
         self.assertEquals(entry.get_attr("undefined"))
示例#3
0
 def test_get_unset_mandatory_field(self):
     entry = address.entry.Entry()
     self.assertEquals(entry.get_attr(address.entry.FNAME), "")
示例#4
0
 def test_get_first_name(self):
     entry = address.entry.Entry("William")
     self.assertEquals(entry.get_attr(address.entry.FNAME), "William")