diff --git a/people.py b/people.py index 888ce07..7fdf6e9 100755 --- a/people.py +++ b/people.py @@ -11,7 +11,7 @@ def setup_people(): """ people = {} _add_oliver(people) - # TODO add another person - Batman + _add_Bat_man(people) return people @@ -22,6 +22,14 @@ def _add_oliver(people): key = new_p.first_name + '_' + new_p.surname people[key] = new_p + +def _add_Bat_man(people): + """ adds oliver """ + new_p = PERSON(first_name='Bat', surname='Man', + age=58, pet=None, hobbies=['Justice', 'Seed']) + key = new_p.first_name + '_' + new_p.surname + people[key] = new_p + def main(): """ main function run as script """ people = setup_people() diff --git a/test_people.py b/test_people.py index e0fcf4a..a7e91d3 100644 --- a/test_people.py +++ b/test_people.py @@ -8,12 +8,11 @@ def test_oliver(): assert oliver.age == 21 assert oliver.hobbies == [] - -def test_Batman(): - Batman = setup_people()['Batman'] - assert Batman.first_name == 'Batman' - assert Batman.age == 21 - assert Batman.hobbies == ['Justice', 'Seed'] +def test_Bat_man(): + Bat_man = setup_people()['Bat_Man'] + assert Bat_man.first_name == 'Bat' + assert Bat_man.age == 58 + assert Bat_man.hobbies == ['Justice', 'Seed'] def test_all_keys_match_names():