Esempio n. 1
0
    def test_transform_index_pass(self):
        size = 9
        actions = [-1, size**size, None]

        for action in actions:
            with pytest.raises(AssertionError):
                transform_index(action, THTransformation.diagonal_right_down,
                                size)
Esempio n. 2
0
    def test_transform_index_flipud(self):
        size = 9
        action = (0, 0)

        expected_action = move_to_index((8, 0), size)
        actual_action = transform_index(move_to_index(action, size),
                                        THTransformation.flipud, size)

        assert expected_action == actual_action
Esempio n. 3
0
    def test_transform_index_rotate_270(self):
        size = 9
        action = (0, 0)

        expected_action = move_to_index((0, 8), size)
        actual_action = transform_index(move_to_index(action, size),
                                        THTransformation.rotate_270, size)

        assert expected_action == actual_action
Esempio n. 4
0
    def test_transform_index_diagonal_right_down(self):
        size = 9
        action = (0, 0)

        expected_action = move_to_index((0, 0), size)
        actual_action = transform_index(move_to_index(action, size),
                                        THTransformation.diagonal_right_down,
                                        size)

        assert expected_action == actual_action