#NEWLINE# def test_pop( self ) : #NEWLINE# #INDENT# d = TransformDict ( str . lower ) #NEWLINE# default = object ( ) #NEWLINE# with self . assertRaises ( KeyError ) : #NEWLINE# #INDENT# d . pop ( 'foo' ) #NEWLINE# #UNINDENT# self . assertIs ( d . pop ( 'foo' , default ) , default ) #NEWLINE# d [ 'Foo' ] = 5 #NEWLINE# self . assertIn ( 'foo' , d ) #NEWLINE# self . assertEqual ( d . pop ( 'foo' ) , 5 ) #NEWLINE# self . assertNotIn ( 'foo' , d ) #NEWLINE# self . check_underlying_dict ( d , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# d [ 'Foo' ] = 5 #NEWLINE# self . assertIn ( 'Foo' , d ) #NEWLINE# self . assertEqual ( d . pop ( 'FOO' ) , 5 ) #NEWLINE# self . assertNotIn ( 'foo' , d ) #NEWLINE# self . check_underlying_dict ( d , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# with self . assertRaises ( KeyError ) : #NEWLINE# #INDENT# d . pop ( 'foo' )