Commit 3e4cd1f64e3e700ff320e76bb268541a52e2a206

Authored by jean perrot
1 parent ded7007d

refactoring test ctselect - time selection 1

Showing 1 changed file with 23 additions and 0 deletions
test/test_ctselect.py
... ... @@ -59,6 +59,7 @@ class Test(test):
59 59 self.append(self._test_empty_ctselect_tool, 'CTSELECT - Test empty ctselect tool')
60 60 self.append(self._test_saving_empty_does_nothing, 'CTSELECT - Test saving empty does nothing')
61 61 self.append(self._test_with_parameters,'CTSELECT - Test with parameters')
  62 + self.append(self._test_time_selcetion,'CTSELECT - Test time selection')
62 63 self.append(self._test_for_ctselect_copy,'CTSELECT - Test ctselect copy')
63 64 self.append(self._test_set_emin_emax, 'CTSELECT - Test set emin emax')
64 65 self.append(self._test_energy_range_beyond_covered, 'CTSELECT - Test energy range beyond energies covered')
... ... @@ -343,6 +344,28 @@ class Test(test):
343 344 # Return
344 345 return
345 346  
  347 + # Unit Test time selection
  348 + def _test_time_selection(self):
  349 + """
  350 + Unit Test time selection
  351 +
  352 + """
  353 + select = self._setup(inobs=self._events,tmin=0.0,tmax=10.0,emin=0.2,emax=80,outobs='ctselect_pyTimeSelection.fits',logfile='ctselect_pyTimeSelection.log')
  354 +
  355 + # Run ctselect tool
  356 + select.logFileOpen() # Make sure we get a log file
  357 + select.run()
  358 + select.save()
  359 +
  360 + # Check result file
  361 + self._check_result_file('ctselect_pyTimeSelection.fits', 'time selection',nevents=10)
  362 +
  363 +
  364 + self._teardown(select)
  365 +
  366 + # Return
  367 + return
  368 +
346 369 # Unit Test for ctselect copy
347 370 def _test_for_ctselect_copy(self):
348 371 """
... ...