#NEWLINE# def test_getitem( self ) : #NEWLINE# #INDENT# l = [ 1 , 2 ] #NEWLINE# self . assertEqual ( utils . getitem ( l , 0 ) , 1 ) #NEWLINE# self . assertEqual ( utils . getitem ( l , 1 ) , 2 ) #NEWLINE# self . assertEqual ( utils . getitem ( l , 3 ) , None ) #NEWLINE# self . assertEqual ( utils . getitem ( l , 3 , 9 ) , 9 ) #NEWLINE# self . assertEqual ( utils . getitem ( data , 'key' ) , None ) #NEWLINE# self . assertEqual ( utils . getitem ( l , 'key' , 8 ) , 8 ) #NEWLINE# data = dict ( a = 'a' , b = 123 ) #NEWLINE# self . assertEqual ( utils . getitem ( data , 'a' ) , 'a' ) #NEWLINE# self . assertEqual ( utils . getitem ( data , 'b' ) , 123 ) #NEWLINE# self . assertEqual ( utils . getitem ( data , 'c' ) , None ) #NEWLINE# self . assertEqual ( utils . getitem ( data , 'c' , 9 ) , 9 )