From b2db543b5d0e281be343743d6be62a8303f0af42 Mon Sep 17 00:00:00 2001 From: MMunglah Date: Thu, 13 Feb 2020 11:37:53 +0000 Subject: [PATCH] add Batman, passes test #17 --- people.py | 10 +++++++++- test_people.py | 11 +++++------ 2 files changed, 14 insertions(+), 7 deletions(-) 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():