def test_can_generate_and_assign_to_rooms(self):
        rooms = alloc.generate_rooms('office')
        self.assertEquals(len(rooms), 10)
        Amity.add_rooms(rooms)
        self.assertIsInstance(rooms[randint(0, 9)], Office)
        rooms = alloc.generate_rooms('living space')
        self.assertEquals(len(rooms), 10)
        Amity.add_rooms(rooms)
        self.assertIsInstance(rooms[randint(0, 9)], LivingSpace)
        self.assertEqual(Amity.room_count, 20)

        # test that file can be parsed
        PeopleFileParser.line_to_person(file_path)
        person_name = 'ANDREW PHILLIPS'
        Manager.assign_to_room(person_name, 'Room 1')
        Manager.assign_to_room(person_name, 'Room 10')
        person = Amity.find_person(person_name)
        self.assertEquals(person.office.name, 'Room 1')
        self.assertIn(person, Amity.find_room('Room 1').occupants)

        # test that manager can make allocations
        Manager.allocate()
        self.assertEquals([], Manager.get_list_of_unallocated_people())
def allocate():
    for person in Amity.people_collection:
        Manager.assign_to_room(person)
 def test_can_assign_singly_to_room(self):
     self.assertEquals(Amity.room_collection[1].has_female_occupant(),
                       False)
     Manager.assign_to_room(self.f, self.l)
     self.assertEquals(Amity.room_collection[1].has_female_occupant(), True)
 def assign_all(room_name):
     for person in persons:
         Manager.assign_to_room(person, room_name)