from puzzles.open_the_lock import open_lock


def test_open_lock():
    assert open_lock(["0201", "0101", "0102", "1212", "2002"], "0202") == 6
    assert open_lock(["8888"], "0009") == 1
    assert open_lock(["0000"], "8888") == -1
    assert (
        open_lock(
            ["8887", "8889", "8878", "8898", "8788", "8988", "7888", "9888"], "8888"
        )
        == -1
    )
