def test_WithDuplicate(self): lst = [1, 2, 2, 1, 0, 0, 15, 15] sortedList = lst cocktailSort(sortedList) self.assertEqual(sortedList, [0, 0, 1, 1, 2, 2, 15, 15])
def test_BigNumbers(self): lst = [135604, 1000000, 45, 78435, 456219832, 2, 546] sortedList = lst cocktailSort(sortedList) self.assertEqual(sortedList, [2, 45, 546, 78435, 135604, 1000000, 456219832])
def test_WithZero(self): lst = [10, 0] sortedList = lst cocktailSort(sortedList) self.assertEqual(sortedList, [0, 10])
def test_TwoUnsorted(self): lst = [2, 1] sortedList = lst cocktailSort(sortedList) self.assertEqual(sortedList, [1, 2])
def test_TwoSorted(self): lst = [1, 2] sortedList = lst cocktailSort(sortedList) self.assertEqual(lst, sortedList)
def test_SingleList(self): lst = [1] sortedList = lst cocktailSort(sortedList) self.assertEqual(lst, sortedList)
def test_EmptyList(self): lst = [] sortedList = lst cocktailSort(sortedList) self.assertEqual(lst, sortedList)