#NEWLINE# def test_insertion_sort( self ) : #NEWLINE# #INDENT# n = 20 #NEWLINE# def check( l , n ) : #NEWLINE# #INDENT# res = self . array_factory ( ( ( [ 9999 ] + l ) + [ ( - 9999 ) ] ) ) #NEWLINE# f ( res , 1 , n ) #NEWLINE# self . assertEqual ( res [ 0 ] , 9999 ) #NEWLINE# self . assertEqual ( res [ ( - 1 ) ] , ( - 9999 ) ) #NEWLINE# self . assertSorted ( l , res [ 1 : ( - 1 ) ] ) #NEWLINE# #UNINDENT# f = self . quicksort . insertion_sort #NEWLINE# l = self . sorted_list ( n ) #NEWLINE# check ( l , n ) #NEWLINE# l = self . revsorted_list ( n ) #NEWLINE# check ( l , n ) #NEWLINE# l = self . initially_sorted_list ( n , ( n // 2 ) ) #NEWLINE# check ( self , n ) #NEWLINE# l = self . revsorted_list ( n ) #NEWLINE# check ( l , n ) #NEWLINE# l = self . random_list ( n ) #NEWLINE# check ( l , n ) #NEWLINE# l = self . duprandom_list ( n ) #NEWLINE# check ( l , n )