#NEWLINE# @ genty_dataset ( successful_copy_with_error_on_failure = genty_args ( source = 'source0' , dest = 'dest0' , error_on_failure = True , copy_successful = True , expect_runtime_error = False ) , failed_copy_with_error_on_failure = genty_args ( source = 'source1' , dest = 'dest1' , error_on_failure = True , copy_successful = False , expect_runtime_error = True ) , failed_copy_without_error_on_failure = genty_args ( source = 'source2' , dest = 'dest2' , error_on_failure = False , copy_successful = False , expect_runtime_error = False ) , successful_copy_without_error_on_failure = genty_args ( source = 'source3' , dest = 'dest3' , error_on_failure = False , copy_successful = True , expect_runtime_error = False ) ) #NEWLINE# def test_copy( self , source , dest , error_on_failure , copy_successful , expect_runtime_error ) : #NEWLINE# #INDENT# client = ShellClient ( self . _HOST , self . _USER ) #NEWLINE# mock_copy_on_client = self . patch ( 'app.util.shell.shell_client.ShellClient._copy_on_client' ) #NEWLINE# res = Response ( returncode = ( 0 if copy_successful else 1 ) ) #NEWLINE# mock_copy_on_client . return_value = res #NEWLINE# if expect_runtime_error : #NEWLINE# #INDENT# with self . assertRaises ( RuntimeError ) : #NEWLINE# #INDENT# client . copy ( dest , dest , error_on_failure ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# self . assertEqual ( client . copy ( source , dest , error_on_failure ) , res ) #NEWLINE# #UNINDENT# mock_copy_on_client . assert_called_once_with ( client , source , dest )