def test_childFam_valid(self): child1 = Individual("I1") child2 = Individual("I2") testFam = Family("F1") child1.childFamilyObject = testFam child2.childFamilyObject = testFam testFam.childrenObjects = [child1, child2] US28_corresponding_family_entries_error(testFam) self.assertEqual(len(testFam.errors), 0) self.assertEqual(testFam.errors, [])
def test_indiv_childFam_invalid(self): indiv = Individual("I1") testFam = Family("F1") indiv.childFamilyObject = testFam US28_corresponding_individual_entries_error(indiv) self.assertEqual(len(indiv.errors), 1) self.assertEqual(indiv.errors[0], "Individual not found as child in F1")
def test_indiv_childFam_valid(self): indiv = Individual("I1") testFam = Family("F1") indiv.childFamilyObject = testFam testFam.childrenObjects.append(indiv) US28_corresponding_individual_entries_error(indiv) self.assertEqual(len(indiv.errors), 0) self.assertEqual(indiv.errors, [])
def test_childFam_one_invalid(self): child1 = Individual("I1") child2 = Individual("I2") testFam = Family("F1") child1.childFamilyObject = testFam testFam.childrenObjects = [child1, child2] US28_corresponding_family_entries_error(testFam) self.assertEqual(len(testFam.errors), 1) self.assertEqual(testFam.errors[0], "Corresponding child family not listed for I2")