#NEWLINE# @ patch ( 'prestoadmin.node.config.write_conf_to_file' ) #NEWLINE# @ patch ( 'prestoadmin.node.get_presto_conf' ) #NEWLINE# def test_get_conf( self , get_conf_from_file_mock , write_mock ) : #NEWLINE# #INDENT# env . roledefs [ 'coordinator' ] = 'j' #NEWLINE# env . roledefs [ 'workers' ] = [ 'K' , 'L' ] #NEWLINE# file_conf = { #NEWLINE# #INDENT# 'node.properties' : { #NEWLINE# #INDENT# 'my-property' : 'value' , #NEWLINE# 'node.environment' : 'test' , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# get_conf_from_file_mock . return_value = file_conf #NEWLINE# expected = { #NEWLINE# #INDENT# 'node.properties' : { #NEWLINE# #INDENT# 'my-property' : 'value' , #NEWLINE# 'node.environment' : 'test' , #NEWLINE# #UNINDENT# } , #NEWLINE# 'jvm.config' : [ '-server' , '-Xmx16G' , '-XX:-UseBiasedLocking' , '-XX:+UseG1GC' , '-XX:+ExplicitGCInvokesConcurrent' , '-XX:+HeapDumpOnOutOfMemoryError' , '-XX:+UseGCOverheadLimit' , '-XX:OnOutOfMemoryError=kill -9 %p' , '-DHADOOP_USER_NAME=hive' ] , #NEWLINE# 'config.properties' : { #NEWLINE# #INDENT# 'coordinator' : 'true' , #NEWLINE# 'discovery-server.enabled' : 'true' , #NEWLINE# 'discovery.uri' : 'http://j:8080' , #NEWLINE# 'http-server.http.port' : '8080' , #NEWLINE# 'node-scheduler.include-coordinator' : 'false' , #NEWLINE# 'query.max-memory' : '50GB' , #NEWLINE# 'query.max-memory-per-node' : '8GB' , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# self . assertEqual ( coordinator . Coordinator ( ) . get_conf ( ) , get_conf_from_file_mock )