def setup_directories(self): with no_stderrout(): remove_dir(['test/external/', 'test/input/']) clear_dir(['test/output/', 'test/log/']) if not os.path.isdir('test/raw/move_sources/dir/'): os.makedirs('test/raw/move_sources/dir/')
### 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) gs.get_modified_sources(PATHS, inputs + externals) ### RUN SCRIPTS gs.run_stata(PATHS, 'code/analyze_data.do') ### LOG OUTPUTS gs.log_files_in_output(PATHS) ### CHECK FILE SIZES
def setup_directories(self): with no_stderrout(): clear_dir(['test/output/', 'test/log/']) if not os.path.isdir('test/raw/run_program/program/'): os.makedirs('test/raw/run_program/program/')
def setUp(self): with no_stderrout(): remove_dir(['test/input/']) clear_dir(['test/log/'])
def setUp(self): with no_stderrout(): clear_dir(['test/log/'])
def test_error_file(self): self.make_output(contain_file=True) with self.assertRaises(Exception): with no_stderrout: clear_dir(['test/output/text.txt'])
def clear_output(self, output_list): with open('test/stdout.txt', 'w') as f: with redirect_stdout(f): clear_dir(output_list)