def test_getitem(self): msg = utils.get_event_message() ev = msg.event self.assertEqual(ev['giraffe'], 1) self.assertIs(type(ev['giraffe']), bt2_field._SignedIntegerField) self.assertEqual(ev['ant'], -1) self.assertIs(type(ev['ant']), bt2_field._SignedIntegerField) self.assertEqual(ev['cpu_id'], 1) self.assertIs(type(ev['cpu_id']), bt2_field._SignedIntegerField) self.assertEqual(ev['something'], 154) self.assertIs(type(ev['something']), bt2_field._UnsignedIntegerField)
def test_event_msg(self): msg = utils.get_event_message() self.assertIs(type(msg.event), bt2_event._Event)
def test_stream(self): msg = utils.get_event_message() self.assertIs(type(msg.event.stream), bt2_stream._Stream)
def test_clock_value(self): msg = utils.get_event_message() self.assertEqual(msg.default_clock_snapshot.value, 789) self.assertIs(type(msg.default_clock_snapshot), bt2_clock_snapshot._ClockSnapshotConst)
def test_attr_payload_field(self): msg = utils.get_event_message() self.assertIs(type(msg.event.payload_field), bt2_field._StructureField)
def test_attr_specific_context_field(self): msg = utils.get_event_message() self.assertIs(type(msg.event.specific_context_field), bt2_field._StructureField)
def test_attr_event_class(self): msg = utils.get_event_message() self.assertIs(type(msg.event.cls), bt2_event_class._EventClass)