Example #1
0
 def test_sdtcal_with_calfile(self):
     if os.path.exists("calibration_summary.png"):
         os.unlink("calibration_summary.png")
     with pytest.raises(SystemExit):
         main_cal([self.calfile])
     assert os.path.exists("calibration_summary.png")
     os.unlink("calibration_summary.png")
Example #2
0
 def test_sdtcal_no_config_dir(self):
     ValueError("No calibrators specified in config file")
     with pytest.raises(ValueError) as excinfo:
         main_cal(["-c", self.config_file_empty])
         assert "No calibrators specified in config file" in str(
             excinfo.value)
Example #3
0
 def test_sdtcal_no_config(self):
     # ValueError("Please specify the config file!")
     with pytest.raises(ValueError) as excinfo:
         main_cal([])
         assert "Please specify the config file!" in str(excinfo.value)
Example #4
0
 def test_sdtcal_with_sample_config(self):
     if os.path.exists('sample_config_file.ini'):
         os.unlink('sample_config_file.ini')
     with pytest.raises(SystemExit):
         main_cal(['--sample-config'])
     assert os.path.exists('sample_config_file.ini')
Example #5
0
 def test_sdtcal_show_with_config(self):
     main_cal(('-c ' + self.config_file + ' --check --show').split(" "))
     assert os.path.exists(self.config_file.replace(".ini", "_cal.hdf5"))
     assert os.path.exists("calibration_summary.png")