Exemple #1
0
def test_inequality(john_doe: family_tree.Person,
                    jane_doe: family_tree.Person):
    couple = family_tree.Couple(john_doe, jane_doe)
    john_doe_new = family_tree.Person("JD1995", "John Doe",
                                      datetime(1995, 6, 20))
    new_couple = family_tree.Couple(jane_doe, john_doe_new)
    assert couple != new_couple
Exemple #2
0
def test_person_addition(my_test_fam: family_tree.Family):
    test_person = family_tree.Person("JD21990", "James Doe",
                                     datetime(1990, 1, 1))
    my_test_fam.add_person(test_person)
    assert len(my_test_fam) == 3
Exemple #3
0
def test_inequality(john_doe_data: PersonData):
    john_first = family_tree.Person(**john_doe_data)
    john_second = family_tree.Person("JD2", john_doe_data["name"])
    assert john_first != john_second
Exemple #4
0
def test_equality(john_doe_data: PersonData):
    john_first = family_tree.Person(**john_doe_data)
    john_second = family_tree.Person(**john_doe_data)
    assert john_first == john_second
Exemple #5
0
def test_only_name():
    person_data = {"identifier": "JD", "name": "John Doe"}

    john_doe = family_tree.Person(**person_data)
    assert john_doe.name == person_data["name"]
Exemple #6
0
def john_doe(john_doe_data: PersonData) -> family_tree.Person:
    return family_tree.Person(**john_doe_data)
Exemple #7
0
def jane_doe(jane_doe_data: PersonData) -> family_tree.Person:
    return family_tree.Person(**jane_doe_data)
Exemple #8
0
def test_person_create(john_doe_data: PersonData):
    john_doe = family_tree.Person(**john_doe_data)
    assert isinstance(john_doe, family_tree.Person)
Exemple #9
0
def test_hash_no_dob():
    james_doe = family_tree.Person("JD1", "James Doe")
    person_set = {james_doe}
    person_set.add(james_doe)
    assert len(person_set) == 1
Exemple #10
0
def john_doe() -> family_tree.Person:
    return family_tree.Person("JD1990", "John Doe", datetime(1990, 1, 1),
                              datetime(2020, 1, 1))
Exemple #11
0
def emily_doe() -> family_tree.Person:
    return family_tree.Person("ED1990", "Emily Doe", datetime(1992, 2, 28),
                              None)
Exemple #12
0
def jane_doe() -> family_tree.Person:
    return family_tree.Person("JD1992", "Jane Doe", datetime(1992, 2, 19),
                              None)