# Path: topoflow/utils/template_files.py
# def get_replacements( var_names=None, values=None, method='RE'):
# def replace( cfg_template_file, new_cfg_file, dictionary=None,
#              method='RE'):
#     RE_METHOD     = (method == 'RE')
#     STRING_METHOD = not(RE_METHOD)


import os
from topoflow.utils import template_files
             'var1, var2 = ${var1}, ${var2}\n',
             'More lines\n']
    template_unit.writelines( lines )
    template_unit.close()

#   make_test_template()
#-------------------------------------------------------------------------
def test1( method='RE' ):

    #-----------------------------
    # Change to a test directory
    #-----------------------------
    test_dir = '/Users/peckhams/Documents'
    os.chdir( test_dir )

    #---------------------------------------------------
    # Get dictionary of replacements (values for vars)
    #---------------------------------------------------
    dictionary = get_replacement_dictionary( method=method )

    #-----------------------------------------
    # Make a fake model config file template
    #-----------------------------------------
    cfg_template_file = 'Model_config_file_template.cfg.in'
    make_test_template( cfg_template_file )

    #-----------------------------------------------------
    # Make replacements to create fake model config file
    #-----------------------------------------------------
    new_cfg_file = 'Model_config_file.cfg'

# Path: topoflow/utils/template_files.py
# def get_replacements( var_names=None, values=None, method='RE'):
# def replace( cfg_template_file, new_cfg_file, dictionary=None,
#              method='RE'):
#     RE_METHOD     = (method == 'RE')
#     STRING_METHOD = not(RE_METHOD)


# Path: topoflow/utils/tests/test_template_files.py
import os
from topoflow.utils import template_files

             'var1, var2 = ${var1}, ${var2}\n',
             'More lines\n']
    template_unit.writelines( lines )
    template_unit.close()

#   make_test_template()
#-------------------------------------------------------------------------
def test1( method='RE' ):

    #-----------------------------
    # Change to a test directory
    #-----------------------------
    test_dir = '/Users/peckhams/Documents'
    os.chdir( test_dir )

    #---------------------------------------------------
    # Get dictionary of replacements (values for vars)
    #---------------------------------------------------
    dictionary = get_replacement_dictionary( method=method )

    #-----------------------------------------
    # Make a fake model config file template
    #-----------------------------------------
    cfg_template_file = 'Model_config_file_template.cfg.in'
    make_test_template( cfg_template_file )

    #-----------------------------------------------------
    # Make replacements to create fake model config file
    #-----------------------------------------------------
    new_cfg_file = 'Model_config_file.cfg'

    template_files.replace( cfg_template_file, new_cfg_file,