#NEWLINE# @ mock . patch ( CHK_QUOTA_STR ) #NEWLINE# @ mock . patch ( 'nova.image.api.API.get' , side_effect = exception . ImageNotFound ( image_id = '100' ) ) #NEWLINE# def test_update_all_image_not_found( self , _get_mocked , quota_mocked ) : #NEWLINE# #INDENT# req = fakes . HTTPRequest . blank ( '/v2/fake/images/100/metadata' ) #NEWLINE# req . method = 'PUT' #NEWLINE# body = { #NEWLINE# #INDENT# 'metadata' : { #NEWLINE# #INDENT# 'key9' : 'value9' , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# req . body = jsonutils . dump_as_bytes ( body ) #NEWLINE# req . headers [ 'content-type' ] = 'application/json' #NEWLINE# self . assertRaises ( webob . exc . HTTPNotFound , self . controller . update_all , _get_mocked , '100' , body = body ) #NEWLINE# self . assertFalse ( quota_mocked . called )