#NEWLINE# def test_metadata_application( self ) : #NEWLINE# #INDENT# self . dir . metadata = { #NEWLINE# #INDENT# '.*\\.png' : { #NEWLINE# #INDENT# 'Key1' : 'Val1' , #NEWLINE# 'Key2' : 'Val2' , #NEWLINE# #UNINDENT# } , #NEWLINE# 'Key3' : 'Val3' , #NEWLINE# #UNINDENT# } #NEWLINE# key = mock . MagicMock ( key = 'test.png' ) #NEWLINE# self . dir . apply_metadata ( key ) #NEWLINE# key . set_metadata . assert_any_call ( 'Key1' , 'Val1' ) #NEWLINE# key . set_metadata . assert_any_call ( 'Key2' , 'Val2' ) #NEWLINE# key . set_metadata_assert_any_call ( 'Key3' , 'Val3' ) #NEWLINE# key = mock . MagicMock ( key = 'test.jpg' ) #NEWLINE# self . dir . apply_metadata ( key ) #NEWLINE# key . set_metadata . assert_called_once_with ( 'Key3' , 'Val3' )