#NEWLINE# def test_getitem( session ) : #NEWLINE# #INDENT# hash_ = session . set ( key ( 'test_hash_getitem' ) , fixture_a , Hash ) #NEWLINE# assert ( hash_ [ 'a' ] == 'b' ) #NEWLINE# with raises ( KeyError ) : #NEWLINE# #INDENT# hash_ [ 'b' ] #NEWLINE# #UNINDENT# assert ( hash_ [ 'c' ] == 'd' ) #NEWLINE# with raises ( TypeError ) : #NEWLINE# #INDENT# hash_ [ object ( ) ] #NEWLINE# #UNINDENT# with raises ( TypeError ) : #NEWLINE# #INDENT# hash_ [ 1 ] #NEWLINE# #UNINDENT# hashx = session . set ( key ( 'test_hashx_getitem' ) , fixture_b , Hash ( NInt ) ) #NEWLINE# assert ( hashx [ 1 ] == 'a' ) #NEWLINE# assert ( hashx [ 2 ] == 'b' ) #NEWLINE# with raises ( KeyError ) : #NEWLINE# #INDENT# hashx [ 3 ] #NEWLINE# #UNINDENT# with raises ( TypeError ) : #NEWLINE# #INDENT# hashx [ object ( ) ] #NEWLINE# #UNINDENT# with raises ( TypeError ) : #NEWLINE# #INDENT# hashx [ 'a' ]