예제 #1
0
    def test_parse_block_not_under_hand(self):
        # given
        mock = HandEyeSimulator(3, True)
        start = ["g", "w", "w", "w", "w", "w", "w", "w", "b", "0"]

        # when
        mock.parse_observation(start)
        end = mock.observe()

        # then
        assert start == end
예제 #2
0
    def test_grip_block(self):
        # given
        mock = HandEyeSimulator(3, True)
        start = ["w", "w", "w", "w", "w", "w", "w", "w", "g", "1"]
        mock.parse_observation(start)

        # when
        was_executed = mock.take_action(4)  # grip
        end = mock.observe()

        # then
        assert ["w", "w", "w", "w", "w", "w", "w", "w", "b", "2"] == end
        assert was_executed is True
예제 #3
0
    def test_move_blocked(self):
        # given
        mock = HandEyeSimulator(3, True)
        start = ["g", "w", "w", "w", "w", "w", "w", "w", "b", "0"]
        mock.parse_observation(start)

        # when
        was_executed = mock.take_action(0)  # move north
        end = mock.observe()

        # then
        assert ["g", "w", "w", "w", "w", "w", "w", "w", "b", "0"] == end
        assert was_executed is False