def test_updatefield(self): md = Table({"street": ["F. R. Lillie", "School St.", "Quissett Ave."], "number": [3784, 78, 83]}) md.setfield("number", [3782, 78, 83]) ans = Table({"street": ["F. R. Lillie", "School St.", "Quissett Ave."], "number": [3782, 78, 83]}) self.assertEqual(md, ans)
def test_updatefield(self): md = Table({"street": ["F. R. Lillie", "School St.", "Quissett Ave."], "number": [3784, 78, 83]}) md.setfield("number", [3782, 78, 83]) ans = Table({"street": ["F. R. Lillie", "School St.", "Quissett Ave."], "number": [3782, 78, 83]}) self.assertEqual(md, ans) return
def test_addfield(self): # data, field syntax used in order to specify field order md = Table([("F R. Lillie", 3784), ("School St.", 78), ("Quissett Ave.", 83)], fields=("street", "number")) md.setfield("driveway", [True, True, False]) ans = Table([("F R. Lillie", 3784, True), ("School St.", 78, True), ("Quissett Ave.", 83, False)], fields=("street", "number", "driveway")) self.assertEqual(md, ans)