#NEWLINE# @ mock . patch . object ( images , '_create_root_fs' , autospec = True ) #NEWLINE# @ mock . patch . object ( utils , 'write_to_file' , autospec = True ) #NEWLINE# @ mock . patch . object ( utils , 'tempdir' , autospec = True ) #NEWLINE# @ mock . patch . object ( utils , 'execute' , autospec = True ) #NEWLINE# @ mock . patch . object ( images , '_generate_cfg' , autospec = True ) #NEWLINE# def test_create_isolinux_image_bios_mkisofs_fails( self , gen_cfg_mock , utils_mock , tempdir_mock , write_to_file_mock , create_root_fs_mock ) : #NEWLINE# #INDENT# mock_file_handle = mock . MagicMock ( spec = file ) #NEWLINE# mock_file_handle . __enter__ . return_value = 'tmpdir' #NEWLINE# tempdir_mock . return_value = mock_file_handle #NEWLINE# utils_mock . side_effect = processutils . ProcessExecutionError #NEWLINE# self . assertRaises ( exception . ImageCreationFailed , images . create_isolinux_image_for_bios , 'tgt_file' , 'path/to/kernel' , 'path/to/ramdisk' )