Esempio n. 1
0
    def test_US16_Male_last_names(self):
        t1 = Family("t1")
        t2 = Family("t2")
        t3 = Family("t3")
        t4 = Family("t4")
        t5 = Family("t5")
        t6 = Family("t6")
        t7 = Family("t7")
        t8 = Family("t8")
        t9 = Family("t9")
        t10 = Family("t10")
        p1 = Individual("p1")
        p2 = Individual("p2")
        p3 = Individual("p3")
        p4 = Individual("p4")
        p5 = Individual("p5")
        p6 = Individual("p6")
        p7 = Individual("p7")
        p8 = Individual("p8")
        p9 = Individual("p9")
        p10 = Individual("p10")
        # --------------------------------------------------
        t1.set_husband(p1)
        t1.add_child(p2)
        t1.add_child(p3)
        t2.set_husband(p2)
        t3.set_husband(p3)
        t2.add_child(p4)
        t3.add_child(p5)
        t4.set_husband(p4)
        t5.set_husband(p5)

        t6.set_husband(p6)
        t6.add_child(p7)
        t6.add_child(p8)
        t7.set_husband(p7)
        t8.set_husband(p8)
        t7.add_child(p9)
        t8.add_child(p10)
        t9.set_husband(p9)
        t10.set_husband(p10)

        p1.set_gender("M")
        p1.set_name("Charles Glass")
        p2.set_gender("M")
        p2.set_name("Charles Glass")
        p3.set_gender("M")
        p3.set_name("Charles Glass")
        p4.set_gender("M")
        p4.set_name("Charles Glass")
        p5.set_gender("M")
        p5.set_name("Charles Glass")

        p6.set_gender("M")
        p6.set_name("Charles Glass")
        p7.set_gender("M")
        p7.set_name("Charles Glass")
        p8.set_gender("M")
        p8.set_name("Charles WDNMD")
        p9.set_gender("M")
        p9.set_name("Charles Glass")
        p10.set_gender("M")
        p10.set_name("Charles Glass")

        # --------------------------------------------------

        assert t3.male_last_names() == True
        assert t8.male_last_names() == False
Esempio n. 2
0
    def testMLastNames(self):
        #family1
        fam1 = Family("1")
        #Husband
        ind1 = Individual("1")
        ind1.set_gender("M")
        ind1.set_name("Charles Glass")

        #Wife
        ind2 = Individual("2")
        ind2.set_gender("F")
        ind2.set_name("Betty Glass")

        #Child 1
        ind3 = Individual("3")
        ind3.set_gender("M")
        ind3.set_name("Nate Glass")

        # Child 2
        ind4 = Individual("4")
        ind4.set_gender("M")
        ind4.set_name("Bobby Glass")

        # Child 3
        ind5 = Individual("5")
        ind5.set_gender("M")
        ind5.set_name("Jack Glass")

        fam1.set_wife(ind2)
        fam1.set_husband(ind1)
        fam1.set_marriedDate((1989, 7, 25))
        fam1.set_children([ind3, ind4, ind5])

        self.assertTrue(fam1.male_last_names())

        #family2
        fam2 = Family("2")
        # Husband
        ind6 = Individual("6")
        ind6.set_gender("M")
        ind6.set_name("Charles Glass")

        # Wife
        ind7 = Individual("7")
        ind7.set_gender("F")
        ind7.set_name("Betty Glass")

        # Child 1
        ind8 = Individual("8")
        ind8.set_gender("F")
        ind8.set_name("Nancy Glass")

        # Child 2
        ind9 = Individual("9")
        ind9.set_gender("M")
        ind9.set_name("Bobby Tarantino")

        # Child 3
        ind10 = Individual("10")
        ind10.set_gender("M")
        ind10.set_name("Jack Glass")

        fam2.set_wife(ind7)
        fam2.set_husband(ind6)
        fam2.set_marriedDate((1992, 3, 17))
        fam2.set_children([ind8, ind9, ind10])

        self.assertFalse(fam2.male_last_names())

        #fam3
        fam3 = Family('3')
        #husband
        fam3.set_husband(ind3)
        ind3.add_to_family(fam3)
        #wife
        ind11 = Individual("11")
        ind11.set_gender("F")
        ind11.set_name("Sandy Glass")
        # Child 1
        ind12 = Individual("12")
        ind12.set_gender("F")
        ind12.set_name("Nancy T")

        # Child 2
        ind13 = Individual("13")
        ind13.set_gender("M")
        ind13.set_name("Bobby Glass")

        fam3.set_wife(ind11)
        fam3.set_children([ind12, ind13])

        self.assertTrue(fam1.male_last_names())

        # fam4
        fam4 = Family('4')
        # husband
        fam4.set_husband(ind4)
        ind4.add_to_family(fam4)
        # wife
        ind14 = Individual("14")
        ind14.set_gender("F")
        ind14.set_name("Sandy Glass")

        # Child 1
        ind15 = Individual("15")
        ind15.set_gender("F")
        ind15.set_name("Nancy T")

        # Child 2
        ind16 = Individual("16")
        ind16.set_gender("M")
        ind16.set_name("Bobby T")

        fam4.set_wife(ind14)
        fam4.set_children([ind15, ind16])

        self.assertFalse(fam1.male_last_names())