Пример #1
0
 def test_pop_and_insert_1(self):
     expected = CircularList().from_iterable([1, 2, 3, 4, 5, 6, 7, 8, 9])
     actual = CircularList().from_iterable([9, 2, 3, 4, 5, 6, 7, 8, 1])
     actual.rotate(-8)
     popped = actual.pop_at()
     actual.insert_at_cursor(popped)
     self.assertEqual(expected, actual)
Пример #2
0
 def test_rotate_insert_rotate_back_3(self):
     expected = CircularList().from_iterable([1, 2, 3, 4, 5, 6, 7, 8, 9])
     actual = CircularList().from_iterable([1, 2, 3, 4, 5, 6, 7, 9])
     actual.rotate(-6)
     actual.insert_at_cursor(8)
     actual.rotate(7)
     self.assertEqual(expected, actual)