Пример #1
0
 def test_amity_list_rooms(self):
     amity = Amity('list_room')
     amity.rooms = []
     self.assertEqual(amity.list_rooms({}), False)
     amity = self.create_room()
     self.assertEqual(amity.list_rooms({'-u': True, '-a': False}), None)
     self.assertEqual(amity.list_rooms({'-u': False, '-a': True}), None)
Пример #2
0
 def create_room(self):
     amity = Amity('create_room')
     args = {
         '<room_name>':
         ['testRoom 1', 'testRoom 2', 'testRoom 3', 'testRoom 1'],
         '<room_type>': ['living', 'office', 'living'],
     }
     amity.rooms = []  # make sure the rooms list is empty
     amity.run_command(args)
     return amity
Пример #3
0
 def test_amity_print_allocations(self):
     amity = Amity('print_allocations')
     amity.rooms = []
     self.assertEqual(amity.print_allocations({}), False)
     self.create_room()
     amity = self.add_person()
     self.assertEqual(amity.print_allocations({'-o': False}), None)
     self.assertEqual(
         amity.print_allocations({
             '-o': True,
             '<file_name>': 'tt.txt'
         }), None)
Пример #4
0
 def test_amity_allocate_returns_false_for_empty_room(self):
     amity = Amity('list_people')
     amity.rooms = []
     person = Fellow('Sunday', 'nwuguru', True)
     self.assertEqual(amity.allocate(person), False)