#NEWLINE# @ mock . patch ( 'sahara.service.edp.hdfs_helper.configure_cluster_for_hdfs' ) #NEWLINE# @ mock . patch ( 'sahara.service.edp.job_utils.resolve_data_source_references' ) #NEWLINE# def test_overridden_driver_classpath( self , resolver , configurer ) : #NEWLINE# #INDENT# job_configs = { #NEWLINE# #INDENT# 'configs' : { #NEWLINE# #INDENT# 'edp.java.main_class' : 'org.me.myclass' , #NEWLINE# 'edp.spark.driver.classpath' : 'my-classpath.jar' , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# files = { #NEWLINE# #INDENT# 'jars' : [ 'app.jar' ] , #NEWLINE# #UNINDENT# } #NEWLINE# data_source = mock . Mock ( ) #NEWLINE# data_source . type = 'hdfs' #NEWLINE# resolver . return_value = ( [ data_source ] , job_configs ) #NEWLINE# master_instance = self . _make_master_instance ( ) #NEWLINE# self . _setup_run_job ( master_instance , configurer , files ) #NEWLINE# master_instance . execute_command . assert_called_with ( ( 'cd %(workflow_dir)s; ./launch_command %(spark_user)s%(spark_submit)s --driver-class-path my-classpath.jar --class org.me.myclass --master %(master)s --deploy-mode %(deploy_mode)s app.jar > /dev/null 2>&1 & echo $!' % { #NEWLINE# #INDENT# 'workflow_dir' : self . workflow_dir , #NEWLINE# 'spark_user' : self . spark_user , #NEWLINE# 'spark_submit' : self . spark_submit , #NEWLINE# 'master' : self . master , #NEWLINE# 'deploy_mode' : self . deploy_mode , #NEWLINE# #UNINDENT# } ) )