#NEWLINE# @ mock . patch ( 'sahara.service.edp.hdfs_helper.create_dir_hadoop2' ) #NEWLINE# def test_edp_calls_hadoop2_create_dir( self , create_dir ) : #NEWLINE# #INDENT# for version in [ '2.7.1' ] : #NEWLINE# #INDENT# cluster_dict = { #NEWLINE# #INDENT# 'name' : ( 'cluster' + version . replace ( '.' , '_' ) ) , #NEWLINE# 'plugin_name' : 'vanilla' , #NEWLINE# 'hadoop_version' : version , #NEWLINE# 'default_image_id' : 'image' , #NEWLINE# #UNINDENT# } #NEWLINE# cluster = conductor . cluster_create ( context . ctx ( ) , cluster_dict ) #NEWLINE# plugin = pb . PLUGINS . get_plugin ( plugin . plugin_name ) #NEWLINE# create_dir . reset_mock ( ) #NEWLINE# plugin . get_edp_engine ( cluster , edp . JOB_TYPE_PIG ) . create_hdfs_dir ( mock . Mock ( ) , '/tmp' ) #NEWLINE# self . assertEqual ( 1 , create_dir . call_count )