Skip to content

Commit

Permalink
add Batman, passes test ARU-Bioinf-ISE#17
Browse files Browse the repository at this point in the history
  • Loading branch information
MMunglah authored and MMunglah committed Feb 13, 2020
1 parent 2e9f4d5 commit b2db543
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
10 changes: 9 additions & 1 deletion people.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def setup_people():
"""
people = {}
_add_oliver(people)
# TODO add another person - Batman
_add_Bat_man(people)
return people


Expand All @@ -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()
Expand Down
11 changes: 5 additions & 6 deletions test_people.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down

0 comments on commit b2db543

Please sign in to comment.