示例#1
0
def test_get_color_on_face():
    cube = Cube()
    for face in FACE_ORDER:
        assert cube.get_color_on_face(face) == face
    cube.rotate(CubicRotation.ry)
    assert cube.get_color_on_face("F") == "L"
    assert cube.get_color_on_face("B") == "R"
    assert cube.get_color_on_face("U") == "U"
    assert cube.get_color_on_face("D") == "D"
    assert cube.get_color_on_face("L") == "B"
    assert cube.get_color_on_face("R") == "F"
    cube.rotate(CubicRotation.rx)
    assert cube.get_color_on_face("F") == "U"
    assert cube.get_color_on_face("R") == "F"
    assert cube.get_color_on_face("B") == "D"
示例#2
0
def test_rotate():
    cube = Cube()
    rot = CubicRotation.ry
    cube.rotate(rot)
    assert np.array_equal(cube.rotation.apply(X), -Z)
    assert np.array_equal(cube.rotation.apply(Y), Y)