コード例 #1
0
 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')
コード例 #2
0
ファイル: test_event_utils.py プロジェクト: damienst/sapphire
 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')
コード例 #3
0
ファイル: test_event_utils.py プロジェクト: damienst/sapphire
 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')
コード例 #4
0
 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')