#NEWLINE# def test_getitem( self ) : #NEWLINE# #INDENT# m = Mesh ( 2 , 2 ) #NEWLINE# m . _data = [ 1 , 2 , 3 , 4 ] #NEWLINE# self . assertEqual ( m [ ( 0 , 0 ) ] , 1 ) #NEWLINE# self . assertEqual ( m [ ( 1 , 0 ) ] , 2 ) #NEWLINE# self . assertEqual ( m [ ( 0 , 1 ) ] , 3 ) #NEWLINE# self . assertEqual ( m [ ( 1 , 1 ) ] , 4 ) #NEWLINE# self . assertRaises ( KeyError , m . __getitem__ , ( 3 , 0 ) ) #NEWLINE# self . assertRaises ( KeyError , m . __getitem__ , ( ( - 1 ) , 0 ) ) #NEWLINE# self . assertRaises ( KeyError , m . __getitem__ , ( 0 , 3 ) ) #NEWLINE# self . assertRaises ( KeyError , m . __getitem__ , ( 0 , ( - 1 ) ) ) #NEWLINE# self . assertEqual ( m . get ( ( 0 , 0 ) , 10 ) , 1 ) #NEWLINE# self . assertEqual ( m . get ( ( 1 , 0 ) , 10 ) , 2 ) #NEWLINE# self . assertEqual ( m . get ( ( 0 , 1 ) , 10 ) , 3 ) #NEWLINE# self . assertEqual ( m . get ( ( 1 , 1 ) , 10 ) , 4 ) #NEWLINE# self . assertEqual ( m . get ( ( 3 , 0 ) , 10 ) , 10 ) #NEWLINE# self . assertEqual ( m . get ( ( ( - 1 ) , 0 ) , 10 ) , 10 ) #NEWLINE# self . assertEqual ( m . get ( ( 0 , 3 ) , 10 ) , 10 ) #NEWLINE# self . assertEqual ( m . get ( ( 0 , ( - 1 ) ) , 10 ) , 10 )