Commit 3e4cd1f64e3e700ff320e76bb268541a52e2a206
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,6 +59,7 @@ class Test(test): | ||
| 59 | self.append(self._test_empty_ctselect_tool, 'CTSELECT - Test empty ctselect tool') | 59 | self.append(self._test_empty_ctselect_tool, 'CTSELECT - Test empty ctselect tool') |
| 60 | self.append(self._test_saving_empty_does_nothing, 'CTSELECT - Test saving empty does nothing') | 60 | self.append(self._test_saving_empty_does_nothing, 'CTSELECT - Test saving empty does nothing') |
| 61 | self.append(self._test_with_parameters,'CTSELECT - Test with parameters') | 61 | self.append(self._test_with_parameters,'CTSELECT - Test with parameters') |
| 62 | + self.append(self._test_time_selcetion,'CTSELECT - Test time selection') | ||
| 62 | self.append(self._test_for_ctselect_copy,'CTSELECT - Test ctselect copy') | 63 | self.append(self._test_for_ctselect_copy,'CTSELECT - Test ctselect copy') |
| 63 | self.append(self._test_set_emin_emax, 'CTSELECT - Test set emin emax') | 64 | self.append(self._test_set_emin_emax, 'CTSELECT - Test set emin emax') |
| 64 | self.append(self._test_energy_range_beyond_covered, 'CTSELECT - Test energy range beyond energies covered') | 65 | self.append(self._test_energy_range_beyond_covered, 'CTSELECT - Test energy range beyond energies covered') |
| @@ -343,6 +344,28 @@ class Test(test): | @@ -343,6 +344,28 @@ class Test(test): | ||
| 343 | # Return | 344 | # Return |
| 344 | return | 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 | # Unit Test for ctselect copy | 369 | # Unit Test for ctselect copy |
| 347 | def _test_for_ctselect_copy(self): | 370 | def _test_for_ctselect_copy(self): |
| 348 | """ | 371 | """ |