#NEWLINE# def test_setslice_cint( self ) : #NEWLINE# #INDENT# a = ( c_int * 100 ) ( * xrange ( 1100 , 1200 ) ) #NEWLINE# b = range ( 1100 , 1200 ) #NEWLINE# a [ 32 : 47 ] = range ( 32 , 47 ) #NEWLINE# self . assertEqual ( a [ 32 : 47 ] , range ( 32 , 47 ) ) #NEWLINE# a [ 32 : 47 ] = range ( 132 , 147 ) #NEWLINE# self . assertEqual ( a [ 32 : 47 ] , range ( 132 , 147 ) ) #NEWLINE# a [ 46 : 31 : ( - 1 ) ] = range ( 232 , 247 ) #NEWLINE# self . assertEqual ( a [ 32 : 47 : 1 ] , range ( 246 , 231 , ( - 1 ) ) ) #NEWLINE# a [ 32 : 47 ] = range ( 1132 , 1147 ) #NEWLINE# self . assertEqual ( a [ : ] , b ) #NEWLINE# a [ 32 : 47 : 7 ] = range ( 3 ) #NEWLINE# b [ 32 : 47 : 7 ] = range ( 3 ) #NEWLINE# self . assertEqual ( a [ : ] , b ) #NEWLINE# a [ 33 : : ( - 3 ) ] = range ( 12 ) #NEWLINE# b [ 33 : : ( - 3 ) ] = range ( 12 ) #NEWLINE# self . assertEqual ( a [ : ] , b ) #NEWLINE# from operator import setslice , setitem #NEWLINE# self . assertRaises ( TypeError , setslice , a , 0 , 5 , 'abcde' ) #NEWLINE# self . assertRaises ( TypeError , setitem , a , slice ( 0 , 5 ) , 'abcde' ) #NEWLINE# self . assertRaises ( TypeError , setslice , a , 0 , 5 , [ 'a' , 'b' , 'c' , 'd' , 'e' ] ) #NEWLINE# self . assertRaises ( TypeError , setitem , a , slice ( 0 , 5 ) , [ 'a' , 'b' , 'c' , 'd' , 'e' ] ) #NEWLINE# self . assertRaises ( TypeError , setslice , a , 0 , 5 , [ 1 , 2 , 3 , 4 , 3.14 ] ) #NEWLINE# self . assertRaises ( TypeError , setitem , a , slice ( 0 , 5 ) , [ 1 , 2 , 3 , 4 , 3.14 ] ) #NEWLINE# self . assertRaises ( ValueError , setslice , a , 0 , 5 , range ( 32 ) ) #NEWLINE# self . assertRaises ( ValueError , setitem , b , slice ( 0 , 5 ) , range ( 32 ) )