#NEWLINE# @ with_config ( { #NEWLINE# #INDENT# 'spark' : { #NEWLINE# #INDENT# 'spark-submit' : ss , #NEWLINE# 'master' : 'spark://host:7077' , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } ) #NEWLINE# @ patch ( 'luigi.contrib.external_program.subprocess.Popen' ) #NEWLINE# def test_run( self , proc ) : #NEWLINE# #INDENT# setup_run_process ( proc ) #NEWLINE# job = TestPySparkTask ( ) #NEWLINE# job . run ( ) #NEWLINE# proc_arg_list = proc . call_args [ 0 ] [ 0 ] #NEWLINE# self . assertEqual ( proc_arg_list [ 0 : 7 ] , [ 'ss-stub' , '--master' , 'spark://host:7077' , '--deploy-mode' , 'client' , '--name' , 'TestPySparkTask' ] ) #NEWLINE# self . assertTrue ( os . path . exists ( proc_arg_list [ 7 ] ) ) #NEWLINE# self . assertTrue ( proc_arg_list [ 8 ] . endswith ( 'TestPySparkTask.pickle' ) )