def test_allocate_room(self): office = Space(1, 'prooms') # check if dictionary has been created self.assertTrue(type(office.room_list), type({})) # check if number passed is corrected self.assertEqual(office.num_rooms, 1) # check if the list of room coincides with the number of rooms # generated self.assertEqual(len(office.room_list), 1) # check if naming convention is right and it exists self.assertTrue('prooms 0' in office.room_list.keys(), True) # check if the list created has empty list self.assertListEqual(office.room_list['prooms 0'], []) # allocate a room name = 'david' r_alloc = (office.allocate_room(name)) # check if name assigned is returned self.assertIn(name, r_alloc,) # remove test file os.remove(office.path)