def test_detector_arrival_time(self): self.event.__getitem__.side_effect = lambda name: 2.5 self.assertEqual(event_utils.detector_arrival_time(self.event, 0), 2.5) self.event.__getitem__.assert_called_with('t1') self.assertEqual(event_utils.detector_arrival_time(self.event, 0, self.offsets), 1.5) self.event.__getitem__.assert_called_with('t1') self.assertEqual(event_utils.detector_arrival_time(self.event, 1, self.offsets), 0.5) self.event.__getitem__.assert_called_with('t2')
def test_no_good_detector_arrival_time(self): self.event.__getitem__.side_effect = lambda name: -999 self.assertTrue(isnan(event_utils.detector_arrival_time(self.event, 0))) self.event.__getitem__.assert_called_with('t1') self.assertTrue( isnan( event_utils.detector_arrival_time(self.event, 0, self.offsets))) self.event.__getitem__.assert_called_with('t1')
def test_detector_arrival_time(self): self.event.__getitem__.side_effect = lambda name: 2.5 self.assertEqual(event_utils.detector_arrival_time(self.event, 0), 2.5) self.event.__getitem__.assert_called_with('t1') self.assertEqual( event_utils.detector_arrival_time(self.event, 0, self.offsets), 1.5) self.event.__getitem__.assert_called_with('t1') self.assertEqual( event_utils.detector_arrival_time(self.event, 1, self.offsets), 0.5) self.event.__getitem__.assert_called_with('t2')
def test_no_good_detector_arrival_time(self): self.event.__getitem__.side_effect = lambda name: -999 self.assertTrue(isnan(event_utils.detector_arrival_time(self.event, 0))) self.event.__getitem__.assert_called_with('t1') self.assertTrue(isnan(event_utils.detector_arrival_time(self.event, 0, self.offsets))) self.event.__getitem__.assert_called_with('t1')