Exemple #1
0
def test_rotate_minus_5():
    d = DoubleLinkedList([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
    d.rotate(-5)
    assert (len(d)) == 10
    assert list(d) == [6, 7, 8, 9, 10, 1, 2, 3, 4, 5]
Exemple #2
0
def test_rotate_2():
    d = DoubleLinkedList([1, 2, 3, 4, 5, 6])
    d.rotate(2)
    assert (len(d)) == 6
    assert list(d) == [5, 6, 1, 2, 3, 4]
Exemple #3
0
def test_rotate__minus_1():
    d = DoubleLinkedList([1, 2, 3, 4])
    d.rotate(-1)
    assert list(d) == [2, 3, 4, 1]
Exemple #4
0
def test_rotate_1():
    d = DoubleLinkedList([1, 2, 3, 4])
    d.rotate(1)
    assert (len(d)) == 4
    assert list(d) == [4, 1, 2, 3]
Exemple #5
0
def test_rotate_minus_5():
    d = DoubleLinkedList([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
    d.rotate(-5)
    assert (len(d)) == 10
    assert list(d) == [6, 7 ,8 , 9, 10, 1, 2, 3, 4, 5]
Exemple #6
0
def test_rotate__minus_1():
    d = DoubleLinkedList([1, 2, 3, 4])
    d.rotate(-1)
    assert list(d) == [2, 3, 4, 1]
Exemple #7
0
def test_rotate_2():
    d = DoubleLinkedList([1, 2, 3, 4, 5, 6])
    d.rotate(2)
    assert (len(d)) == 6
    assert list(d) == [5, 6, 1, 2, 3, 4]
Exemple #8
0
def test_rotate_1():
    d = DoubleLinkedList([1, 2, 3, 4])
    d.rotate(1)
    assert (len(d)) == 4
    assert list(d) == [4, 1, 2, 3]