#NEWLINE# def test_update_config_file2( self ) : #NEWLINE# #INDENT# 'Test config file update utility, version 2.' #NEWLINE# input_dir = dbutil . input_directory ( self . MODULE , self . SUITE ) #NEWLINE# output_dir = dbutil . output_directory ( self . MODULE , self . SUITE ) #NEWLINE# expected_dir = dbutil . expected_directory ( self . MODULE , self . SUITE ) #NEWLINE# updates = { #NEWLINE# #INDENT# 'dbname' : 'TEST_DBNAME' , #NEWLINE# 'temp_dir' : 'TEST_TEMP_DIR' , #NEWLINE# 'tile_root' : 'TEST_TILE_ROOT' , #NEWLINE# #UNINDENT# } #NEWLINE# config_file_name = 'test_datacube.conf' #NEWLINE# output_file_name = 'test2_datacube.conf' #NEWLINE# output_path = dbutil . update_config_file2 ( updates , input_dir , output_dir , config_file_name , output_file_name ) #NEWLINE# expected_path = os . path . join ( expected_dir , output_file_name ) #NEWLINE# if ( not os . path . isfile ( expected_path ) ) : #NEWLINE# #INDENT# self . skipTest ( 'Expected config file not found.' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# subprocess . check_output ( [ 'diff' , output_path , expected_path ] ) #NEWLINE# #UNINDENT# except subprocess . CalledProcessError as err : #NEWLINE# #INDENT# self . fail ( ( 'Config file does not match expected result:\n' + err . output ) )