예제 #1
0
 def setUp(self):
     makelog_file = '../output/make.log'
     output_dir = '../output/'
     with nostderrout():
         clear_output_dirs(output_dir, '')
         start_make_logging(makelog_file)
         run_stata(program='./input/stata_test_script.do')
예제 #2
0
 def test_custom_directories(self):
     self.assertFalse(os.path.isdir('../customoutput/'))
     self.assertFalse(os.path.isdir('../customtemp/'))
     with nostderrout():
         clear_output_dirs('../customoutput/', '../customtemp/')
         start_make_logging('../customoutput/make.log')
     self.assertTrue(os.path.isdir('../customoutput/'))
     self.assertTrue(os.path.isdir('../customtemp/'))
     self.assertTrue(os.path.isfile('../customoutput/make.log'))
예제 #3
0
 def test_default_log(self):
     makelog_file = '../output/make.log'
     output_dir = '../output/'
     with nostderrout():
         clear_output_dirs(output_dir, '')
         start_make_logging(makelog_file)
         list_directory('./input/externals_list_directory/')
     self.check_log('./input/externals_list_directory/', makelog_file)
     self.check_log('./input/externals_list_directory/private/',
                    makelog_file)
예제 #4
0
 def test_custom_log(self):
     os.remove('../output/make.log')
     makelog_file = '../output/custom_make.log'
     output_dir = '../output/'
     with nostderrout():
         clear_output_dirs(output_dir, '')
         start_make_logging(makelog_file)
         run_stata(program='./input/stata_test_script.do',
                   makelog='../output/custom_make.log')
     logfile_data = open('../output/custom_make.log', 'r').read()
     self.assertIn('end of do-file', logfile_data)
예제 #5
0
 def setUp(self):
     makelog_file = '../output/make.log'
     output_dir = '../output/'
     with nostderrout():
         clear_output_dirs(output_dir, '')
         start_make_logging(makelog_file)
     log_to_del = 'Delete this file \n'
     log_to_del_file = 'del_log.txt'
     outfile = open(log_to_del_file, 'w')
     outfile.write(''.join(log_to_del))
     outfile.close()
예제 #6
0
 def test_custom_log(self):
     os.remove('../output/make.log')
     makelog_file = '../output/custom_make.log'
     output_dir = '../output/'
     with nostderrout():
         clear_output_dirs(output_dir, '')
         start_make_logging(makelog_file)
         run_mathematica(program='./input/mathematica_test_script.m',
                         makelog='../output/custom_make.log')
     logfile_data = open('../output/custom_make.log', 'r').read()
     self.assertIn('mathematica test ended', logfile_data)
     self.assertTrue(os.path.isfile('output_plot.eps'))
예제 #7
0
 def test_custom_log(self):
     os.remove('../output/make.log')
     makelog_file = '../output/custom_make.log'
     output_dir = '../output/'
     with nostderrout():
         clear_output_dirs(output_dir, '')
         start_make_logging(makelog_file)
         run_matlab(program='./input/matlab_test_script.m',
                    makelog='../output/custom_make.log')
     self.assert_proper_output('../output/custom_make.log')
     self.assertTrue(os.path.isfile('../output/matlab_test.mat'))
     self.assertTrue(os.path.isfile('../output/matlab_test.eps'))
예제 #8
0
 def test_custom_log(self):
     os.remove('../output/make.log')
     makelog_file = '../output/custom_make.log'
     output_dir = '../output/'
     with nostderrout():
         clear_output_dirs(output_dir, '')
         start_make_logging(makelog_file)
         run_perl(program='./input/perl_test_script.pl',
                  makelog='../output/custom_make.log')
     logfile_data = open('../output/custom_make.log', 'r').read()
     self.assertIn('Test script completed', logfile_data)
     self.assertTrue(os.path.isfile('output.txt'))
예제 #9
0
 def test_custom_log(self):
     os.remove('../output/make.log')
     makelog_file = '../output/custom_make.log'
     output_dir = '../output/'
     with nostderrout():
         clear_output_dirs(output_dir, '')
         start_make_logging(makelog_file)
         run_lyx(program='./input/lyx_test_file.lyx',
                 makelog='../output/custom_make.log')
     logfile_data = open('../output/custom_make.log', 'r').read()
     self.assertIn('LaTeX', logfile_data)
     self.assertTrue(os.path.isfile('../output/lyx_test_file.pdf'))
예제 #10
0
 def test_custom_log(self):
     os.remove('../output/make.log')
     makelog_file = '../output/custom_make.log'
     output_dir = '../output/'
     with nostderrout():
         clear_output_dirs(output_dir, '')
         start_make_logging(makelog_file)
         run_rinstall(
             package='./input/rinstall_test_package/Ecdat_0.1-6.1.tar.gz',
             makelog='../output/custom_make.log')
     self.assertTrue(
         self.last_line_equals('../output/custom_make.log',
                               '* DONE (Ecdat)\n'))
예제 #11
0
 def test_custom_log(self):
     self.assertFalse(os.path.isfile('test_data.txt'))
     os.remove('../output/make.log')
     makelog_file = '../output/custom_make.log'
     output_dir = '../output/'
     with nostderrout():
         clear_output_dirs(output_dir, '')
         start_make_logging(makelog_file)
         if sys.platform.startswith('win'):
             run_command(command='wzunzip ./input/zip_test_file.zip ./',
                         makelog='../output/custom_make.log')
         else:
             run_command(command='unzip ./input/zip_test_file.zip',
                         makelog='../output/custom_make.log')
     logfile_data = open('../output/custom_make.log', 'r').readlines()
     self.assertIn('test_data.txt', logfile_data[-1])
     self.assertTrue(os.path.isfile('test_data.txt'))
예제 #12
0
 def test_set_option(self):
     with nostderrout():
         set_option(makelog='../customoutput/custommake.log',
                    temp_dir='../customtemp/',
                    output_dir='../customoutput/',
                    manifest='../customoutput/data_file_manifest.log')
         clear_output_dirs()
         start_make_logging()
         run_stata(program='./input/stata_test_script_alt.do')
     self.remove_manifest_entry('../customoutput/data_file_manifest.log', 1)
     with nostderrout():
         check_manifest()
         end_make_logging()
     self.assertTrue(os.path.isdir('../customoutput/'))
     self.assertTrue(os.path.isdir('../customtemp/'))
     self.assertTrue(os.path.isfile('../customoutput/custommake.log'))
     self.assertTrue(
         self.check_results('../customoutput/custommake.log', 1, 0))
예제 #13
0
 def setUp(self):
     makelog_file = '../output/make.log'
     output_dir = '../output/'
     with nostderrout():
         clear_output_dirs(output_dir, '')
         start_make_logging(makelog_file)
예제 #14
0
    def setUp(self):
        self.output_dir = '../output/'

        with nostderrout():
            clear_output_dirs(self.output_dir, '')
            start_make_logging(self.output_dir + 'make.log')