示例#1
0
 def test_corresponding_indi(self):
     indi_dict = build_individual_list(PATH)
     fam_dict = build_family_list(PATH)
     family_corresponding_in_indi(indi_dict, fam_dict)
     self.assertEqual([
         str(error) for error in indi_dict['026I06'].error_list
     ], [
         'Error: Individual: US26: 39: 026I06: Corresponding issue happened. 126I03 '
         'not found in family list.'
     ])
     self.assertEqual([
         str(error) for error in indi_dict['026I04'].error_list
     ], [
         'Error: Individual: US26: 26: 026I04: Corresponding issue happened. '
         'Family 126I02 does not have individual 026I04.'
     ])
     self.assertEqual([
         str(error) for error in indi_dict['026I07'].error_list
     ], [
         'Error: Individual: US26: 45: 026I07: Corresponding issue happened. '
         'Family 126I02 does not have individual 026I07.'
     ])
     self.assertEqual([
         str(error) for error in indi_dict['026I08'].error_list
     ], [
         'Error: Individual: US26: 51: 026I08: Corresponding issue happened. '
         'Family 126I02 does not have individual 026I08.'
     ])
示例#2
0
 def test_no_marriage_to_children_us17(self):
     family_dict = build_family_list(PATH)
     no_marriage_to_children_us17(family_dict)
     self.assertEqual([
         str(error) for error in family_dict['F5'].error_list
     ], [
         "ERROR: FAMILY: US17: 53: F5: mother I10 married to her child I08"
     ])
示例#3
0
    def test_div_before_death(self):
        path = r"..\..\test.ged"
        family_dict = build_family_list(path)
        div_before_death(family_dict)

        self.assertEqual([str(error) for error in family_dict['F1'].error_list],
                         ["ERROR: FAMILY: US06: 79: F1: divorce date 1996-05-18 00:00:00 "
                          "after husband's death 1949-12-31 00:00:00"])
示例#4
0
 def test_first_cousin_should_not_marry_us19(self):
     family_dict = build_family_list(path1)
     first_cousin_should_not_marry_us19(family_dict)
     self.assertEqual([
         str(error) for error in family_dict['119F5'].error_list
     ], [
         'Error: FAMILY: US19: 104: 119F5: First cousins marry one another happened in family 119F5'
     ])
示例#5
0
 def test_US05(self):
     family_dict = build_family_list(path2)
     US05(family_dict)
     self.assertEqual(
         [str(error) for error in family_dict['105F1'].error_list], [
             "Error: FAMILY: US05: 22: 105F1: Married 5 JAN 1992 after "
             "husband's (105I01) death on 11 DEC 1991"
         ])
示例#6
0
    def test_date_before_current(self):
        path = r"..\..\test.ged"
        family_dict = build_family_list(path)
        indi_dict=build_individual_list(path)
        date_before_current(indi_dict,family_dict)

        self.assertEqual([str(error) for error in indi_dict['I04'].error_list],
                         ["ERROR: INDIVIDUAL: US01: 26: I04: birthday date 2022-05-04 00:00:00 before today"])
示例#7
0
 def test_US04(self):
     family_dict = build_family_list(path1)
     USO4(family_dict)
     self.assertEqual([
         str(error) for error in family_dict['104F1'].error_list
     ], [
         'Error: FAMILY: US04: 26: 104F1: Divorced 18 May 1888 before married 17 FEB 1966'
     ])
示例#8
0
 def test_unique_first_names_in_families_us25(self):
     family_dict = build_family_list(PATH)
     unique_first_names_in_families_us25(family_dict)
     self.assertEqual([
         str(error) for error in family_dict['125F1'].error_list
     ], [
         "ANOMALY: FAMILY: US25: 114: 125F1: "
         "children ['025I03', '025I04', '025I05'] of family 125F1 have the same first name 'GuGu'"
     ])
示例#9
0
 def test_birth_b_marriage_us02(self):
     family_dict = build_family_list(path)
     birth_b_marriage_us02(family_dict)
     self.assertEqual([str(error) for error in family_dict['F2'].error_list],
                      ["ERROR: FAMILY: US02: 26: F2:  "
                       "wife I04 birthday 4 May 2022 isn't before married date 5 FEB 1997"])
     self.assertEqual([str(error) for error in family_dict['F3'].error_list],
                      ["ERROR: FAMILY: US02: 26: F3:  "
                       "wife I04 birthday 4 May 2022 isn't before married date 5 JAN 1992"])
示例#10
0
 def test_multiple_siblings(self):
     path = r"..\..\test15.ged"
     family_dict = build_family_list(path)
     multiple_siblings(family_dict)
     self.assertEqual([
         str(error) for error in family_dict['115F1'].error_list
     ], [
         "ERROR: FAMILY: US15: 103: 115F1: More than 15 siblings in one family."
     ])
示例#11
0
    def test_sibi_not_marry(self):
        path = r"..\..\test1.ged"
        family_dict = build_family_list(path)
        sibi_not_marry(family_dict)

        self.assertEqual([
            str(error) for error in family_dict['F5'].error_list
        ], [
            "ANOMALY: FAMILY: US18: 94: F5: Siblings should not marry one another"
        ])
示例#12
0
    def test_US11(self):
        individual_dict = build_individual_list(path)
        family_dict = build_family_list(path)
        US11(individual_dict, family_dict)

        self.assertEqual([
            str(error) for error in individual_dict['011I04'].error_list
        ], [
            'Error: INDIVIDUAL: US11: 61: 011I04: bigamy happened on family 011F2 and family 011F3'
        ])
示例#13
0
    def test_unique_family_24(self):
        path = r"..\..\test2124.ged"
        family_dict = build_family_list(path)
        unique_family_24(family_dict)

        self.assertEqual([
            str(error) for error in family_dict['F1242'].error_list
        ], [
            "ANOMALY: FAMILY: US24: 46: F1242: wife should have same marry date in different family"
        ])
示例#14
0
 def test_parents_not_too_old_us12(self):
     family_dict = build_family_list(PATH)
     parents_not_too_old_us12(family_dict)
     self.assertEqual([
         str(error) for error in family_dict['F4'].error_list
     ], [
         "ERROR: FAMILY: US12: 63: F4: "
         "father I09 7 Jul 1923 is not less than 80 years old than child I08 7 Jul 2003",
         "ERROR: FAMILY: US12: 71: F4: "
         "mother I10 7 Jul 1942 is not less than 60 years old than child I08 7 Jul 2003"
     ])
示例#15
0
    def test_marry_after_14(self):
        path = r"..\..\test1.ged"
        family_dict = build_family_list(path)
        marry_after_14(family_dict)

        self.assertEqual([
            str(error) for error in family_dict['F2'].error_list
        ], [
            "ANOMALY: FAMILY: US10: 78: F2: Child I04's marry date is 1997-02-05 00:00:00,"
            "less than 14 years after 1990-05-04 00:00:00 "
        ])
示例#16
0
    def test_corrent_gender_us21(self):
        path = r"..\..\test2124.ged"
        family_dict = build_family_list(path)
        corrent_gender_us21(family_dict)

        self.assertEqual([
            str(error) for error in family_dict['F1211'].error_list
        ], [
            "ANOMALY: FAMILY: US21: 37: F1211: husband's gender should be male",
            "ANOMALY: FAMILY: US21: 38: F1211: wife's gender should be female"
        ])
 def test_birth_before_marriage(self):
     family_dict = build_family_list(path)
     birth_before_marriage(family_dict)
     self.assertEqual(
         [str(error) for error in family_dict['F1'].error_list], [
             "ANOMALY: FAMILY: US08: 19: F1: Child I03 born "
             "1968-06-05 00:00:00 before marriage on 2001-02-17 00:00:00",
             "ANOMALY: FAMILY: US09: 19: F1: Child I03 born 1968-06-05 "
             "00:00:00 after daddy's death on 1949-12-31 00:00:00"
         ])
     self.assertEqual(
         [str(error) for error in family_dict['F2'].error_list], [
             "ANOMALY: FAMILY: US08: 33: F2: Child I05 born 1994-06-05"
             " 00:00:00 before marriage on 1997-02-05 00:00:00"
         ])
示例#18
0
 def test_corresponding_family(self):
     indi_dict = build_individual_list(PATH)
     fam_dict = build_family_list(PATH)
     indi_corresponding_in_family(indi_dict, fam_dict)
     self.assertEqual([
         str(error) for error in fam_dict['126I01'].error_list
     ], [
         'Error: Family: US26: 57: 126I01: Corresponding issue happened. Family '
         "126I01's children 026I04 has wrong family Id."
     ])
     self.assertEqual([
         str(error) for error in fam_dict['126I02'].error_list
     ], [
         "Error: Family: US26: 61: 126I02: Corresponding issue happened. "
         "Family 126I02's spouse 026I06 has wrong family Id.",
         "Error: Family: US26: 62: 126I02: Corresponding issue happened. "
         "Family 126I02's spouse 026I05 has wrong family Id.",
         "Error: Family: US26: 63: 126I02: Corresponding issue happened. "
         "Family 126I02's children 026I03 has wrong family Id."
     ])
示例#19
0
 def test_unique_fam_id(self):
     path = r"..\..\test22.ged"
     family_dict = build_family_list(path)
     self.assertEqual([str(error) for error in family_dict['122F1'].error_list],
                      ["ERROR: FAMILY: US22: 36: 122F1: Family ID 122F1 should be unique!"])
示例#20
0
 def test_birth_before_marriage(self):
     family_dict = build_family_list(path)
     multiple_birth(family_dict)
     self.assertEqual([str(error) for error in family_dict['F1'].error_list],
                      ["ERROR: FAMILY: US14: 43: F1: More than 5 siblings born at the same day."])