def testUS16(self): # us16 inputGed = open("data/inputRZ1.ged", "r") inputGed1 = open("data/inputRZ2.ged", "r") output = readGed.fam(inputGed) output1 = readGed.fam(inputGed1) self.assertEqual(us16.sameLastName(output[0], output[2]), name1) self.assertEqual(us16.sameLastName(output1[0], output1[2]), name2)
def testUS29(self): inputGed = open("data/inputRZ1.ged", "r") inputGed1 = open("data/inputRZ2.ged", "r") output = readGed.fam(inputGed) output1 = readGed.fam(inputGed1) self.assertEqual(us29.deaths(output[0], output[2]), deaths1) self.assertEqual(us29.deaths(output1[0], output1[2]), deaths2)
def testUS32(self): inputGed = open("data/Sprint1.ged", "r") inputGed1 = open("data/input_8.ged", "r") output = readGed.fam(inputGed) output1 = readGed.fam(inputGed1) self.assertEqual(us32.checkMultipleBirths(output[2]), us32res) self.assertEqual(us32.checkMultipleBirths(output1[2]), us32res1)
def testUS07(self): inputGed = open("data/Sprint1.ged", "r") inputGed1 = open("data/input_8.ged", "r") output = readGed.fam(inputGed) output1 = readGed.fam(inputGed1) self.assertEqual( us07.checkForLessThan150(output[0], output[2]), ["ERROR: INDIVIDUAL: US07: I3 is older than 150 line 35"]) self.assertEqual( us07.checkForLessThan150(output1[0], output1[2]), ["ERROR: INDIVIDUAL: US07: I9 death - birth > 150 line 95"])
def testUS31(self): inputGed = open("data/Sprint1.ged", "r") inputGed1 = open("data/input_6.ged", "r") output = readGed.fam(inputGed) output1 = readGed.fam(inputGed1) self.assertEqual(us31.checkForLivingSingle(output1[0], output1[2]), [ 'ERROR: INDIVIDUAL: US31: I4 Rocky /Quinto/ on line: 45 is living and single', 'ERROR: INDIVIDUAL: US31: I11 John /Quinto/ on line: 117 is living and single' ]) inputGed.close() self.assertEqual(us31.checkForLivingSingle(output[0], output[2]), []) inputGed1.close()
def testUS23(self): inputGed = open("data/UniqueNames.ged", "r") output = readGed.fam(inputGed) self.assertEqual(us23.uniqueNameAndBirthday(output[0], output[2]), [ 'ERROR: INDIVIDUAL: US23: I25 does not have a unique name and birthday on line: 245', 'ERROR: INDIVIDUAL: US23: I26 does not have a unique name and birthday on line: 254' ])
def testUS24(self): inputGed = open("data/Sprint4.ged") allLists = readGed.fam(inputGed) # no clue why this is not returning errors self.assertEqual(us24.main(allLists[1], allLists[3]), [ 'ERROR: FAMILY: US24: DUPLICATE FAMILY: F11 WITH HUSBAND: Dan /Jones/ AND WIFE Ashley /Jones/ MARRIED ON 2035-04-30 on line 404' ])
def testUS05(self): inputGed = open("data/Sprint1.ged", "r") output = readGed.fam(inputGed) self.assertEqual(us05.main(output[0], output[1], output[3]), [ "ERROR: INDIVIDUAL: US05: I4: Marriage date occurs after their date of death on line 82." ]) inputGed.close()
def testUS04(self): inputGed = open("data/Sprint1.ged", "r") output = readGed.fam(inputGed) self.assertEqual(us04.marriageBeforeDivorce(output[1]), [ 'ERROR: FAMILY: US04: F1: Divorce date occurs before their marriage.' ]) inputGed.close()
def testUS37(self): inputGed = open("data/Sprint2.ged", "r") allLists = readGed.fam(inputGed) self.assertEqual(us37.main(allLists[0], allLists[1], allLists[3]), [ "ERROR: FAMILY: US37: I2: passed within the last 30 days leaving behind their spouse: I3 and children: ['I1', 'I4'] on line 231" ]) inputGed.close()
def testUS26(self): inputGed = open("data/Sprint2.ged", "r") output = readGed.fam(inputGed) self.assertEqual(us26.corrEntries(output), [ "ERROR: FAMILY: US26: Family F2 does not have the correct corresponding entries on line 231", "ERROR: FAMILY: US26: Family F3 does not have the correct corresponding entries on line 237", "ERROR: FAMILY: US26: Family F4 does not have the correct corresponding entries on line 261" ])
def testUS34(self): inputGed = open("data/Sprint3.ged") output = readGed.fam(inputGed) self.assertEqual( us34.largeAgeDifferences(output[0], output[1], output[2]), [ 'ERROR: INDIVIDUAL: US34: Individual I5 was over twice as old as spouse I1 at their time of marriage on line: ', 'ERROR: INDIVIDUAL: US34: Individual I6 was over twice as old as spouse I4 at their time of marriage on line: ' ])
def testUS10(self): inputGed = open("data/Orphan.ged", "r") output = readGed.fam(inputGed) self.assertEqual(us10.main(output[0], output[1], output[3]), [ 'ERROR: INDIVIDUAL: US10: I1 marriage date occurs before they are 15 on line 245', 'ERROR: INDIVIDUAL: US10: I4 marriage date occurs before they are 15 on line 260', 'ERROR: INDIVIDUAL: US10: I5 marriage date occurs before they are 15 on line 245', 'ERROR: INDIVIDUAL: US10: I6 marriage date occurs before they are 15 on line 260' ])
def testUS12(self): inputGed = open("data/Sprint1.ged", "r") output = readGed.fam(inputGed) self.assertEqual( us12.checkForOldParents(output[0], output[1], output[2]), [ "ERROR: US12: Individual: I1's father is too old on line: 14", "ERROR: US12: Individual: I1's mother is too old on line: 14", "ERROR: US12: Individual: I4's father is too old on line: 44", "ERROR: US12: Individual: I4's mother is too old on line: 44" ])
def testUS03(self): inputGed = open("data/Sprint2.ged", "r") inputGed1 = open("data/input_6.ged", "r") output = readGed.fam(inputGed) inputGed.close() self.assertEqual(us03.birthBeforeDeath(output[0], output[2]), [ "ERROR: INDIVIDUAL: US03: I4 on line: 44: Death date occurs before their date of birth." ]) inputGed1.close()
def testUS30(self): inputGed = open("data/Sprint1.ged", "r") inputGed1 = open("data/input_6.ged", "r") output = readGed.fam(inputGed) output1 = readGed.fam(inputGed1) inputGed.close() self.assertEqual(us30.checkForLivingMarried(output), [ 'NOTE: INDIVIDUAL: US30: I1 Edward /Rogers/ is living and married on line 14', 'NOTE: INDIVIDUAL: US30: I3 Emily /Rogers/ is living and married on line 35', 'NOTE: INDIVIDUAL: US30: I5 Marcia /Rogers/ is living and married on line 56', 'NOTE: INDIVIDUAL: US30: I6 Tim /Jones/ is living and married on line 65' ]) self.assertEqual(us30.checkForLivingMarried(output1), [ 'NOTE: INDIVIDUAL: US30: I1 Chloe /Quinto/ is living and married on line 15', 'NOTE: INDIVIDUAL: US30: I2 Rafael /Quinto/ is living and married on line 25', 'NOTE: INDIVIDUAL: US30: I3 Maria /Quinto/ is living and married on line 35', 'NOTE: INDIVIDUAL: US30: I5 Thompson /L/ is living and married on line 54', 'NOTE: INDIVIDUAL: US30: I8 Grandpa /Loresco/ is living and married on line 86' ]) inputGed1.close()
def testUS28(self): inputGed = open("data/Sprint2.ged", "r") output = readGed.fam(inputGed) self.assertEqual( us28.orderSiblings(output), { 'F1': [['I1', -13, 14]], 'F2': [['I4', -19, 44]], 'F4': [['I7', 4, 74], ['I8', 3, 84]], 'F5': [['I10', 2, 104], ['I9', 0, 94]], 'F3': [['I11', 1, 114], ['I12', 1, 123], ['I13', 1, 132], ['I14', 1, 141], ['I15', 1, 150], ['I16', 1, 159], ['I17', 0, 168], ['I18', -1, 177], ['I19', -2, 186], ['I20', -3, 195], ['I21', -5, 213]] })
def testUS17(self): inputGed = open("data/Sprint4.ged", "r") allLists = readGed.fam(inputGed) self.assertEqual( us17.main(allLists[1], allLists[3]), ['ERROR: FAMILY: US17: HUSBAND MARRIED HIS CHILD ON LINE: 410'])
def testUS06(self): inputGed = open("data/Sprint1.ged", "r") output = readGed.fam(inputGed) self.assertEqual(us06.main(output[0], output[1], output[3]), [ "ERROR: INDIVIDUAL: US06: I4: Divorce date occurs after their date of death on line 88" ])
def testUS14(self): inputGed = open("data/Sprint2.ged", "r") output = readGed.fam(inputGed) self.assertEqual(us14.main(output[0], output[1], output[3]), [ "ERROR: FAMILY: US14: F4 more than 5 siblings have multiple birthdays on year 2018 line 261" ])
def testUS22(self): inputGed = open("data/Sprint2.ged", "r") output = readGed.fam(inputGed) self.assertEqual(us22.uniqueIDs(output), (['I21'], []))
def testUS25(self): inputGed = open("data/Sprint3.ged") output = readGed.fam(inputGed) self.assertTrue(us25.uniqueFirstNames(output))
def testUS27(self): inputGed = open("data/Sprint3.ged") output = readGed.fam(inputGed) self.assertEqual(us27.listPeopleAndAge(output[0], output[2]), None)
def testUS15(self): inputGed = open("data/Sprint2.ged", "r") output = readGed.fam(inputGed) self.assertEqual(us15.checkFewerThan15(output[1], output[2]), [ "ERROR: FAMILY: US15: True I3 family has more than 15 siblings line 35" ])
def testUS18(self): inputGed = open("data/Sprint2.ged", "r") output = readGed.fam(inputGed) self.assertEqual(us18.main(output), [ "ERROR: FAMILY: US18: ['I8', 'I7'] Siblings should not marry on line 237." ])
def testUS39(self): inputGed = open("data/Sprint2.ged", "r") output = readGed.fam(inputGed) self.assertEqual(us39.main(output[1], output[3]), None) inputGed.close()
def testUS36(self): inputGed = open("data/Sprint2.ged", "r") output = readGed.fam(inputGed) self.assertEqual(us36.main(output), None)
def testUS33(self): inputGed = open("data/Orphan.ged", "r") output = readGed.fam(inputGed) self.assertTrue( us33.checkForOrphan(output[0], output[1], output[2]), ["NOTE: US33: Individual I24 is an orphan on line 236"])
def testUS42(self): inputGed = open("data/inputRZ1.ged", "r") output = readGed.fam(inputGed) self.assertTrue(us42.filterDates(output))