def detect(gedfile): """Pretty print the individuals and family tables and detect errors and anomalies of the given file""" ged = Gedcom(gedfile) mongo_instance = MongoDB() # mongo_instance.delete_database() mongo_instance.drop_collection("family") mongo_instance.drop_collection("individual") ged.pretty_print() ged.insert_to_mongo() ged.us01_date_validate() ged.us02_birth_before_marriage() ged.us03_birth_before_death() ged.us04_marr_b4_div() ged.us05_marriage_before_death() ged.us06_divorce_before_death() ged.us07_less_than_150_yrs() ged.us08_birt_b4_marr_of_par() ged.us11_no_bigamy() ged.us13_sibling_spacing() ged.us14_multi_birt_less_than_5() ged.us16_male_last_name() ged.us17_no_marriages_to_children() ged.us18_siblings_should_not_marry() ged.us19_first_cousins_should_not_marry() ged.us20_aunts_and_uncle() ged.us21_correct_gender_for_role() ged.us22_unique_ids() ged.us23_unique_name_and_birt() ged.us26_corrspnding_entries() ged.msg_print()
def test_mar_before_birt(self): """ Marriage before birth""" ged = Gedcom('./GEDCOM_files/us02/us02_mar_before_birt.ged') self.assertEqual(ged.us02_birth_before_marriage(debug=True), [('husband', '08/06/3169', '@F1@', 'Oswaldo Mccarthy', '@I2@', '01/01/1992')])
def test_mar_on_birt_wife(self): """ Marriage is on the birth date""" ged = Gedcom('./GEDCOM_files/us02/us02_mar_on_birt.ged') self.assertEqual(ged.us02_birth_before_marriage(debug=True), [('wife', '04/17/1972', '@F1@', 'Sherika Ault', '@I3@', '08/06/1969')])
def test_mar_after_birt(self): """ Marriage is after birth""" ged = Gedcom('./GEDCOM_files/us02/us02_mar_after_birt.ged') self.assertEqual(ged.us02_birth_before_marriage(debug=True), [])