def test_executer_can_add_people_to_room(self):
        amity = Amity()

        room = RoomFactory.create("Moon", 4)
        Amity.add_object_to_dictionary(amity, room)
        Amity.modify_dictionary_element(amity, "room", "000001", "purpose", "office")

        person = PersonFactory.create("fellow", "Femi", 25, "M", wants_residence="Y", level="D1")
        Amity.add_object_to_dictionary(amity, person)

        Executor.assign_occupant_to_room(person, room)
        self.assertIn(person.id, room.occupants)
        self.assertEqual(room.occupant_count, 1)
        self.assertEqual(amity.rooms["000001"].occupants, person)
Esempio n. 2
0
    def test_executer_can_add_people_to_room(self):
        amity = Amity()

        room = RoomFactory.create("Moon", 4)
        Amity.add_object_to_dictionary(amity, room)
        Amity.modify_dictionary_element(amity, "room", "000001", "purpose",
                                        "office")

        person = PersonFactory.create("fellow",
                                      "Femi",
                                      25,
                                      "M",
                                      wants_residence="Y",
                                      level="D1")
        Amity.add_object_to_dictionary(amity, person)

        Executor.assign_occupant_to_room(person, room)
        self.assertIn(person.id, room.occupants)
        self.assertEqual(room.occupant_count, 1)
        self.assertEqual(amity.rooms["000001"].occupants, person)
Esempio n. 3
0
    def test_amity_can_add_people_to_room(self):
        amity = Amity()

        room = RoomFactory.create("Moon", 4)
        Amity.add_object_to_dictionary(amity, room)
        Amity.modify_dictionary_element(amity, "room", "000001", "purpose", "office")

        person1 = PersonFactory.create("fellow", "Femi", 25, "M", wants_residence="Y", level="D1")
        Amity.add_object_to_dictionary(amity, person1)

        Amity.assign_occupant_to_room(amity, person1, room)

        person2 = PersonFactory.create("staff", "Bob", 20, "F", job_title="Facilitator", department="Learning and Development")
        Amity.add_object_to_dictionary(amity, person2)

        Amity.assign_occupant_to_room(amity, person2, room)

        self.assertIn(person1.id, room.occupants)
        self.assertIn(person2.id, room.occupants)
        # pdb.set_trace()
        self.assertEqual(room.occupant_count, 2)
        self.assertEqual(amity.rooms["000001"].occupants, {'000001': person1, '000002': person2})
Esempio n. 4
0
    def test_amity_can_add_people_to_room(self):
        amity = Amity()

        room = RoomFactory.create("Moon", 4)
        Amity.add_object_to_dictionary(amity, room)
        Amity.modify_dictionary_element(amity, "room", "000001", "purpose",
                                        "office")

        person1 = PersonFactory.create("fellow",
                                       "Femi",
                                       25,
                                       "M",
                                       wants_residence="Y",
                                       level="D1")
        Amity.add_object_to_dictionary(amity, person1)

        Amity.assign_occupant_to_room(amity, person1, room)

        person2 = PersonFactory.create("staff",
                                       "Bob",
                                       20,
                                       "F",
                                       job_title="Facilitator",
                                       department="Learning and Development")
        Amity.add_object_to_dictionary(amity, person2)

        Amity.assign_occupant_to_room(amity, person2, room)

        self.assertIn(person1.id, room.occupants)
        self.assertIn(person2.id, room.occupants)
        # pdb.set_trace()
        self.assertEqual(room.occupant_count, 2)
        self.assertEqual(amity.rooms["000001"].occupants, {
            '000001': person1,
            '000002': person2
        })