コード例 #1
0
    def test_ok_2(self):
        ged = self.generate_fam_1(marriage="01 JAN 2000",
                                  births=["25 DEC 2020", "19 JUL 2023"])

        fams, indis = proj.parse_ged_data(ged)
        output = validation.validate_no_sextuples(fams, indis)
        self.assertEqual(output, [])
コード例 #2
0
    def test_bad_25(self):
        ged = self.generate_fam_1(marriage="01 JAN 2000",
                                  births=["25 DEC 2020" for _ in range(25)])

        fams, indis = proj.parse_ged_data(ged)
        output = validation.validate_no_sextuples(fams, indis)
        self.assertEqual(
            output,
            [('F1', 'Family id=F1 has more than 5 children born together')])
コード例 #3
0
    def test_ok_duo6(self):
        ged1 = self.generate_fam_1(marriage="01 JAN 2000",
                                   births=[
                                       "25 DEC 2020", "25 DEC 2021",
                                       "25 DEC 2022", "25 DEC 2023",
                                       "25 DEC 2024", "25 DEC 2025"
                                   ])
        ged2 = self.generate_fam_1(marriage="01 JAN 2000",
                                   births=[
                                       "25 DEC 2020", "25 DEC 2021",
                                       "25 DEC 2022", "25 DEC 2023",
                                       "25 DEC 2024", "25 DEC 2025"
                                   ],
                                   id=2)

        fams, indis = proj.parse_ged_data(ged1 + ged2)
        output = validation.validate_no_sextuples(fams, indis)
        self.assertEqual(output, [])
コード例 #4
0
    def test_bad_duo6(self):
        ged1 = self.generate_fam_1(marriage="01 JAN 2000",
                                   births=[
                                       "25 DEC 2020", "25 DEC 2020",
                                       "25 DEC 2020", "25 DEC 2020",
                                       "25 DEC 2020", "25 DEC 2020"
                                   ])
        ged2 = self.generate_fam_1(marriage="01 JAN 2000",
                                   births=[
                                       "25 DEC 2020", "25 DEC 2020",
                                       "25 DEC 2020", "25 DEC 2020",
                                       "25 DEC 2020", "25 DEC 2020"
                                   ],
                                   id=2)

        fams, indis = proj.parse_ged_data(ged1 + ged2)
        output = validation.validate_no_sextuples(fams, indis)
        self.assertEqual(
            output,
            [('F1', 'Family id=F1 has more than 5 children born together'),
             ('F2', 'Family id=F2 has more than 5 children born together')])