Ejemplo n.º 1
0
 def test_log_output_depth_one(self):
     with no_stderrout():
         paths = self.make_paths()
         inputs = link_inputs(paths,
                              ['test/raw/log_sources/move_depth.txt'])
         write_source_logs(paths, inputs, depth=1)
         self.assertIn('depth_1.txt', read_file(paths['source_statslog']))
         self.assertIn('depth_2.txt', read_file(paths['source_statslog']))
Ejemplo n.º 2
0
 def test_log_output_character(self):
     with no_stderrout():
         paths = self.make_paths()
         inputs = link_inputs(paths, ['test/raw/log_sources/move_╬▓.txt'])
         write_source_logs(paths, inputs)
         self.check_makelog(paths)
         self.assertIn('dir_╬▓', read_file(paths['source_maplog']))
         self.assertIn('file_╬▓.txt', read_file(paths['source_statslog']))
Ejemplo n.º 3
0
 def test_error_bad_path(self):
     with no_stderrout():
         try:
             paths = {}
             inputs = link_inputs(paths,
                                  ['test/raw/log_sources/move space.txt'])
             write_source_logs(paths, inputs)
         except Exception as e:
             self.assertRaises(Exception, e)
Ejemplo n.º 4
0
    def test_log_output_depth_recursive(self):
        """
        Note
        ----
        For some reason, recursive symlinks don't actually break as expected.
        Python just stops walking the recursive directory at a certain point.
        """
        with no_stderrout():
            paths = {
                'makelog': 'test/log/make.log',
                'input_dir': 'test/input',
                'output_dir': 'test/input',
                'output_statslog': 'test/log/output_stats.log'
            }

            start_makelog(paths)
            link_inputs(paths, ['test/raw/log_outputs/recursion.txt'])
            log_files_in_output(paths)
Ejemplo n.º 5
0
 def test_log_output_no_log(self):
     with no_stderrout():
         paths = self.make_paths(source_maplog_path='',
                                 source_statslog_path='')
         inputs = link_inputs(paths,
                              ['test/raw/log_sources/move space.txt'])
         write_source_logs(paths, inputs)
         self.check_makelog(paths)
         self.assertFalse(os.path.isfile(paths['source_maplog']))
         self.assertFalse(os.path.isfile(paths['source_statslog']))
Ejemplo n.º 6
0
 def test_log_output_depth_recursive(self):
     """
     Note
     ----
     For some reason, recursive symlinks don't actually break as expected.
     Python just stops walking the recursive directory at a certain point.
     """
     with no_stderrout():
         paths = self.make_paths()
         inputs = link_inputs(paths,
                              ['test/raw/log_sources/move_recursion.txt'])
         write_source_logs(paths, inputs)
Ejemplo n.º 7
0
### 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
gs.check_module_size(PATHS)

### END MAKE
gs.end_makelog(PATHS)
Ejemplo n.º 8
0
 def test_log_output(self):
     with no_stderrout():
         paths = self.make_paths()
         inputs = link_inputs(paths, ['test/raw/log_sources/move.txt'])
         write_source_logs(paths, inputs)
         self.check_logs(paths)
Ejemplo n.º 9
0
 def move_function(self, *args):
     link_inputs(*args)