def test_rotate_based_on(test_input, x, expected): scrambler = Scrambler(test_input) assert scrambler.rotate_based_on(x) == expected
def test_swap_position(): scrambler = Scrambler(list('abcde')) assert scrambler.swap_position(4, 0) == list('ebcda')
def test_move(test_input, x, y, expected): scrambler = Scrambler(test_input) assert scrambler.move(x, y) == expected
def test_rotate_right(test_input, x, expected): scrambler = Scrambler(test_input) assert scrambler.rotate_right(x) == expected
def test_rotate_left(): scrambler = Scrambler(list('abcde')) assert scrambler.rotate_left(1) == list('bcdea')
def test_reverse(): scrambler = Scrambler(list('edcba')) assert scrambler.reverse(0, 4) == list('abcde')
def test_swap_letter(): scrambler = Scrambler(list('ebcda')) assert scrambler.swap_letter('d', 'b') == list('edcba')