def test_N_host(self): d_event1 = device_events_1(10) d_event2 = device_events_2(10) d_event3 = device_events_3(10) d_event4 = device_events_4(10) d_event5 = device_events_5(10) d_event6 = device_events_6(10) d_event7 = device_events_7(10) d_event8 = device_events_8(10) d_event9 = device_events_9(10) d_event10 = device_events_10(10) self.assertIsInstance(d_event1, device_events_1, 'Failure: Not an instance of device_events_1') self.assertIsInstance(d_event2, device_events_2, 'Failure: Not an instance of device_events_2') self.assertIsInstance(d_event3, device_events_3, 'Failure: Not an instance of device_events_3') self.assertIsInstance(d_event4, device_events_4, 'Failure: Not an instance of device_events_4') self.assertIsInstance(d_event5, device_events_5, 'Failure: Not an instance of device_events_5') self.assertIsInstance(d_event6, device_events_6, 'Failure: Not an instance of device_events_6') self.assertIsInstance(d_event7, device_events_7, 'Failure: Not an instance of device_events_7') self.assertIsInstance(d_event8, device_events_8, 'Failure: Not an instance of device_events_8') self.assertIsInstance(d_event9, device_events_9, 'Failure: Not an instance of device_events_9') self.assertIsInstance(d_event10, device_events_10, 'Failure: Not an instance of device_events_10')
def test_copy_constructor_from_device(self): d_event = device_events_10(100) h_event = host_events_10(d_event) self.assertIsInstance(h_event, host_events_10, 'Failure: Not an instance of host_events_10') self.check_equals(d_event, h_event)
def test_size(self): d_event = device_events_10(100) d_event.resize(1000) self.assertEqual(d_event.GetNEvents(), 1000)
def test_setFlag(self): d_event = device_events_10(100) d_event.setFlag(1, True) self.assertAlmostEqual(d_event.getFlag(1), True)
def test_Daughters(self): d_event = device_events_10(100) for d in d_event.Daughters(3): self.assertAlmostEqual(d, (0.0, 0.0, 0.0, 0.0))
def test_weights(self): d_event = device_events_10(100) for i in range(100): d_event.setWeight(i, 9.876123456745) for weight in d_event.Weights(): self.assertAlmostEqual(weight, 9.876123456745)
def test_flags(self): d_event = device_events_10(100) for flag in d_event.Flags(): self.assertEqual(flag, False)
def test_get_max_weight(self): d_event = device_events_10(100) d_event.SetMaxWeight(10.838597782598) self.assertAlmostEqual(d_event.GetMaxWeight(), 10.838597782598)
def test_assign_host(self): d_event = device_events_10(100) d_event.setWeight(10, 10.838597782598) h_event = host_events_10() d_event.assign(h_event) self.check_equals(d_event, h_event)
def test_assign_device(self): d_event = device_events_10(100) d_event.setWeight(10, 10.838597782598) d_event_2 = device_events_10() d_event_2.assign(d_event) self.check_equals(d_event, d_event_2)
def test_setWeight(self): d_event = device_events_10(100) d_event.setWeight(10, 10.838597782598) self.assertAlmostEqual(d_event.getWeight(10), 10.838597782598)
def test_copy_constructor_from_device(self): d_event = device_events_10(100) d_event_2 = device_events_10(d_event) self.assertIsInstance(d_event_2, device_events_10, 'Failure: Not an instance of device_events_10') self.check_equals(d_event, d_event_2)
def test_argument_constructor(self): d_event = device_events_10(100) self.assertIsInstance(d_event, device_events_10, 'Failure: Not an instance of device_events_10') self.assertEqual(d_event.GetNEvents(), 100)
def test_default_constructor(self): d_event = device_events_10() self.assertIsInstance(d_event, device_events_10, 'Failure: Not an instance of device_events_10')
def test_assign_device(self): h_event = device_events_10(100) h_event.setWeight(10, 10.838597782598) h_event_2 = host_events_10() h_event_2.assign(h_event) self.check_equals(h_event, h_event_2)