Пример #1
0
def test_top_and_bottom_mixed_face_is_domino():
    for _ in range(TEST_SIZE):
        face = CubeFace(0)
        for row in (0, 2):
            face.set_line(row, choices([0, 5], k=3))

        assert face.is_domino
Пример #2
0
def test_an_unsolved_rotated_face_is_still_unsolved():
    face = CubeFace(5)
    face.set_line(0, (5, 3, 2))

    for _ in range(4):
        face.rotate()

        assert not face.is_solved
Пример #3
0
def test_a_rotated_face_is_still_solved():
    face = CubeFace(3)
    face.rotate()

    assert face.is_solved

    face.rotate(False)
    face.rotate(False)

    assert face.is_solved
Пример #4
0
def test_face_with_a_facelet_replaced_is_not_solved():
    face = CubeFace(4)
    face.set_line(3, (2, 4, 4))

    assert not face.is_solved
Пример #5
0
def test_the_face_is_initially_solved():
    for i in range(6):
        face = CubeFace(i)

        assert face.is_solved
Пример #6
0
def test_3x3_face_has_9_facelets():
    face = CubeFace(0)
    for i in range(9):
        assert face.get_facelet(i)
Пример #7
0
def test_cube_string_is_correct_with_a_row_replaced():
    face = CubeFace(0)
    face.set_line(2, (2, 5, 3))

    assert face.cube_string == "UUUUUUFDR"
Пример #8
0
def test_side_faces_are_not_domino():
    for i in range(1, 5):
        face = CubeFace(i)

        assert not face.is_domino
Пример #9
0
def test_initial_facelets_are_correct_on_3x3_with_twos():
    face = CubeFace(2)

    assert face.facelets == [[2, 2, 2], [2, 2, 2], [2, 2, 2]]
Пример #10
0
def test_initial_rows_and_lines_are_correct_on_3x3_with_fives():
    face = CubeFace(5)

    for line in range(6):
        assert face.get_line(line) == (5, 5, 5)
Пример #11
0
def test_initial_colums_are_correct_on_3x3_with_zeroes():
    face = CubeFace(0)

    for line in range(6):
        assert face.get_line(line) == (0, 0, 0)
Пример #12
0
def test_bottom_face_with_a_side_facelet_is_not_domino():
    face = CubeFace(5)
    face.set_line(0, [4, 5, 5])

    assert not face.is_domino
Пример #13
0
def test_top_face_with_a_side_facelet_is_not_domino():
    face = CubeFace(0)
    face.set_line(2, [0, 2, 0])

    assert not face.is_domino
Пример #14
0
def test_top_face_is_domino():
    face = CubeFace(0)

    assert face.is_domino
Пример #15
0
def test_cube_string_is_correct_on_solved_face():
    for i in range(6):
        face = CubeFace(i)

        assert face.cube_string == face.sides[i] * 9
Пример #16
0
 def __init__(self):
     self.__faces = [CubeFace(i) for i in range(6)]
Пример #17
0
def test_bottom_face_is_domino():
    face = CubeFace(5)

    assert face.is_domino