def sample_cube() -> Cube: cube = Cube((3, 3, 3)) orientation = Orientation() assert orientation.get_side_rotation() == 0 red = cube.get_side(orientation) _set_side_colors(red, [[Color.ORANGE, Color.RED, Color.GREEN], [Color.YELLOW, Color.RED, Color.GREEN], [Color.BLUE, Color.WHITE, Color.GREEN]]) green = cube.get_side(orientation.to_right) _set_side_colors(green, [[Color.RED, Color.ORANGE, Color.ORANGE], [Color.RED, Color.GREEN, Color.WHITE], [Color.RED, Color.GREEN, Color.WHITE]]) orange = cube.get_side(orientation.to_left.to_left) _set_side_colors(orange, [[Color.YELLOW, Color.YELLOW, Color.RED], [Color.ORANGE, Color.ORANGE, Color.WHITE], [Color.ORANGE, Color.ORANGE, Color.GREEN]]) blue = cube.get_side(orientation.to_left) _set_side_colors(blue, [[Color.YELLOW, Color.YELLOW, Color.YELLOW], [Color.BLUE, Color.BLUE, Color.RED], [Color.ORANGE, Color.WHITE, Color.WHITE]]) yellow = cube.get_side(orientation.to_top) _set_side_colors(yellow, [[Color.BLUE, Color.GREEN, Color.GREEN], [Color.BLUE, Color.YELLOW, Color.YELLOW], [Color.BLUE, Color.BLUE, Color.WHITE]]) white = cube.get_side(orientation.to_bottom) _set_side_colors(white, [[Color.RED, Color.GREEN, Color.YELLOW], [Color.RED, Color.WHITE, Color.ORANGE], [Color.WHITE, Color.BLUE, Color.BLUE]]) assert_cube(cube, "ORG/YRG/BWG", "ROO/RGW/RGW", "YYR/OOW/OOG", "YYY/BBR/OWW", "BGG/BYY/BBW", "RGY/RWO/WBB") return cube
def test_get_side_rotation(front: Side, top: Side, rotation: int): orientation = Orientation(front, top) assert orientation.get_side_rotation() == rotation