#NEWLINE# @ mock . patch . object ( firmware_controller , 'get_fw_extractor' , spec_set = True , autospec = True ) #NEWLINE# def test_process_firmware_image_throws_for_failed_extraction( self , get_extractor_mock ) : #NEWLINE# #INDENT# exc = exception . ImageExtractionFailed ( image_ref = 'some_file' , reason = 'God only knows!' ) #NEWLINE# get_extractor_mock . return_value . extract . side_effect = exc #NEWLINE# self . assertRaises ( exception . ImageExtractionFailed , utils . process_firmware_image , self . some_compact_fw_file , self . client )