def test_arrogate_from_existing_staff(self): office = Office("staff" + 'Focs') staff = Staff("staff" + "Erits", "staff" + "Teno", "0785534224", "Y") office.allocate_to(staff) allocated_1 = office.has_allocation(staff) office.arrogate_from(staff) allocated_2 = office.has_allocation(staff) self.assertEqual([allocated_1, allocated_2], [True, False])
def test_reallocate_fellow_to_office(self): office = Office('000848') Office.add(office) fellow = Fellow("UNlsldg", "Ilslnis", "070555597537", "N") office.allocate_to(fellow) office1 = Office('M9498987') Office.add(office1) Room.reallocate(fellow, office1) self.assertEqual([office1.has_allocation(fellow), office.has_allocation(fellow)], [True, False])
def test_reallocate_staff_to_office(self): office = Office('Myok848') Office.add(office) staff = Staff("UNidng", "Inignis", "07089797537") office.allocate_to(staff) office1 = Office('M949438') Office.add(office1) Room.reallocate(staff, office1) self.assertEqual([office1.has_allocation(staff), office.has_allocation(staff)], [True, False])
def test_reallocate_to_room_at_capacity(self): office = Office('0884oo848') Office.add(office) fellowx = Fellow("UNjlksd", "Ilnjndis", "070000345537", "N") office.allocate_to(fellowx) office1 = Office('M94llj87') Office.add(office1) fellow = Fellow("Usdsd", "Isdsds", "070015837", "N") office1.allocate_to(fellow) fellow = Fellow("rereed", "Iererds", "234235837", "N") office1.allocate_to(fellow) fellow = Fellow("Usdsdfsd", "Iskops", "079879787", "N") office1.allocate_to(fellow) fellow = Fellow("Uhoidfd", "Ioijfdsoids", "089437237", "N") office1.allocate_to(fellow) with self.assertRaises(ValueError): Room.reallocate(fellowx, office1) self.assertEqual([office1.has_allocation(fellowx), office.has_allocation(fellowx)], [False, True])