Пример #1
0
    def test_set_room_new_room(self) -> None:
        """Test manipulating rooms in system."""
        room1 = Room(id='10')
        room2 = Room(id='11')
        room3 = Room(id='12')
        system = System(rooms=[room1, room2])

        system.set_room(room3.id, room3)
        self.assertEqual(3, len(system.rooms))
Пример #2
0
    def test_set_room_existing_room(self) -> None:
        """Test manipulating rooms in system."""
        room1 = Room(id='10')
        room2 = Room(id='11')
        room3 = Room(id='11')
        system = System(rooms=[room1, room2])

        system.set_room(room3.id, room3)
        self.assertEqual(2, len(system.rooms))
        self.assertEqual(room3, system._rooms[room2.id])