def test_amity_list_people(self): self.create_room() amity = Amity('list_people') amity.people = [] self.assertEqual(amity.list_people({}), False) self.add_person(False, False) amity = self.add_person(True, False) self.assertEqual(amity.list_people({'-u': True, '-a': False}), None) self.assertEqual(amity.list_people({'-u': False, '-a': True}), None)
def test_amity_load_person(self): self.create_room() amity = Amity('load_people') amity.people = [] args = { '<file_location>': 'data/people_test.txt', } amity.run_command(args) self.assertEqual(len(amity.people), 2)
def add_person(self, living_space=True, reset=True): amity = Amity('add_person') args = { '<firstname>': 'test', '<lastname>': 'user', '<person_type>': 'fellow', '-w': living_space, } if reset: amity.people = [] # make sure the people list is empty amity.run_command(args) return amity
def test_amity_save_people_state(self): amity = Amity('save_state') amity.people = [] self.assertEqual(amity.save_people_state(), False)