def test_ne_cc_prio_map(self): notif = bt2.EventNotification(self._event) event_copy = copy.copy(self._event) event_copy.packet = self._packet cc_prio_map_copy = copy.copy(self._cc_prio_map) notif2 = bt2.EventNotification(event_copy, cc_prio_map_copy) self.assertNotEqual(notif, notif2)
def test_ne_event(self): notif = bt2.EventNotification(self._event, self._cc_prio_map) event_copy = copy.copy(self._event) event_copy.payload_field['my_int'] = 17 event_copy.packet = self._packet cc_prio_map_copy = copy.copy(self._cc_prio_map) notif2 = bt2.EventNotification(event_copy, cc_prio_map_copy) self.assertNotEqual(notif, notif2)
def __next__(self): if self._at == 0: notif = bt2.EventNotification(self._ev1) elif self._at == 1: notif = bt2.EventNotification(self._ev2) else: raise bt2.Stop self._at += 1 return notif
def __next__(self): if self._at == 5: raise bt2.Stop notif = bt2.EventNotification(self._create_event(self._at * 3)) self._at += 1 return notif
def test_create_with_cc_prio_map(self): notif = bt2.EventNotification(self._event, self._cc_prio_map) self.assertEqual(notif.event.addr, self._event.addr) self.assertEqual(len(notif.clock_class_priority_map), 1) self.assertEqual( notif.clock_class_priority_map.highest_priority_clock_class.addr, self._clock_class.addr) self.assertEqual(notif.clock_class_priority_map[self._clock_class], 231)
def _get_event(self): notif = bt2.EventNotification(self._event, self._cc_prio_map) return babeltrace.reader_event._create_event(notif)
def test_deepcopy(self): notif = bt2.EventNotification(self._event, self._cc_prio_map) notif2 = copy.deepcopy(notif) self.assertEqual(notif, notif2)
def test_eq_invalid(self): notif = bt2.EventNotification(self._event) self.assertNotEqual(notif, 23)
def test_create_no_cc_prio_map(self): notif = bt2.EventNotification(self._event) self.assertEqual(notif.event.addr, self._event.addr) self.assertEqual(len(notif.clock_class_priority_map), 0)