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
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
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
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
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"]
def john_doe(john_doe_data: PersonData) -> family_tree.Person: return family_tree.Person(**john_doe_data)
def jane_doe(jane_doe_data: PersonData) -> family_tree.Person: return family_tree.Person(**jane_doe_data)
def test_person_create(john_doe_data: PersonData): john_doe = family_tree.Person(**john_doe_data) assert isinstance(john_doe, family_tree.Person)
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
def john_doe() -> family_tree.Person: return family_tree.Person("JD1990", "John Doe", datetime(1990, 1, 1), datetime(2020, 1, 1))
def emily_doe() -> family_tree.Person: return family_tree.Person("ED1990", "Emily Doe", datetime(1992, 2, 28), None)
def jane_doe() -> family_tree.Person: return family_tree.Person("JD1992", "Jane Doe", datetime(1992, 2, 19), None)