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_same_lastname(self): """ Positive test, males' last names are the same""" mongo_instance = MongoDB() mongo_instance.drop_collection("family") mongo_instance.drop_collection("individual") ged = Gedcom('./GEDCOM_files/us16/us16_male_last_name_same.ged') ged.insert_to_mongo() self.assertEqual(ged.us16_male_last_name(debug=True), [])
def test_diff_lastname(self): """ Negative test, males' last names are different""" mongo_instance = MongoDB() mongo_instance.drop_collection("family") mongo_instance.drop_collection("individual") ged = Gedcom('./GEDCOM_files/us16/us16_male_last_name_diff.ged') ged.insert_to_mongo() self.assertEqual(ged.us16_male_last_name(debug=True), [('@F1@', '@I2@, @I3@', 'LastName,Test')])