def test_data_rotation(sample_cube: Cube) -> None: orientation = Orientation(Side.FRONT, Side.TOP) sample_cube.set_data(orientation, 0, 2, "b") sample_cube.set_data(orientation, 1, 2, "a") sample_cube.turn_vertical(orientation, 3, 1) def get_side(orient: Orientation) -> str: return data_to_string(sample_cube.get_side(orient)) assert get_side( orientation) == "None None None/None None None/None None None" assert get_side( orientation.to_right) == "None a b/None None None/None None None" assert get_side( orientation.to_top) == "None None b/None None a/None None None"
def test_rotation_leftmost(sample_cube: Cube) -> None: orientation = Orientation(Side.BACK, Side.BOTTOM) sample_cube.turn_vertical(orientation, 1, 3) assert_cube(sample_cube, "BRG/BRG/BWG", "ROO/RGW/RGW", "YYW/OOR/OOR", "OBY/WBY/WRY", "GGG/WYY/RBW", "OGY/YWO/BBB")
def test_rotation_rightmost(sample_cube: Cube) -> None: orientation = Orientation(Side.FRONT, Side.RIGHT) sample_cube.turn_vertical(orientation, -1, 1) assert_cube(sample_cube, "ORG/YRG/OWW", "ROO/RGW/BWG", "YYR/OOW/RGW", "YYY/BBR/OOG", "BGG/BYY/BBW", "WRR/BWG/BOY")