Exemple #1
0
import os
import sys

### LOAD GSLAB MAKE
ROOT = '..'
gslm_path = os.path.join(ROOT, 'lib', 'gslab_make')

sys.path.append(gslm_path)
import gslab_make as gs

### PULL PATHS FROM CONFIG
PATHS = {'root': ROOT, 'config': os.path.join(ROOT, 'config.yaml')}
PATHS = gs.update_internal_paths(PATHS)

### LOAD CONFIG USER
PATHS = gs.update_external_paths(PATHS)
gs.update_executables(PATHS)

############
### MAKE ###
############

### START MAKE
gs.remove_dir(['input', 'external'])
gs.clear_dir(['output', 'log'])
gs.start_makelog(PATHS)

### MAKE LINKS TO INPUT AND EXTERNAL FILES
inputs = gs.link_inputs(PATHS, ['input.txt'])
externals = gs.link_externals(PATHS, ['external.txt'])
gs.write_source_logs(PATHS, inputs + externals)
Exemple #2
0
 def test_error_bad_paths(self):
     PATHS = {}
     with self.assertRaises(Exception):
         PATHS = update_external_paths(PATHS)
Exemple #3
0
 def test_config_empty(self):
     PATHS = {'config_user': '******'}
     PATHS = update_external_paths(PATHS)
Exemple #4
0
 def test_error_config_missing(self):
     PATHS = {'config_user': '******'}
     with self.assertRaises(Exception):
         PATHS = update_external_paths(PATHS)
Exemple #5
0
 def test_config_character(self):
     PATHS = {'config_user': '******'}
     PATHS = update_external_paths(PATHS)