示例#1
0
 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)
示例#2
0
 def test_event_msg(self):
     msg = utils.get_event_message()
     self.assertIs(type(msg.event), bt2_event._Event)
示例#3
0
 def test_stream(self):
     msg = utils.get_event_message()
     self.assertIs(type(msg.event.stream), bt2_stream._Stream)
示例#4
0
 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)
示例#5
0
 def test_attr_payload_field(self):
     msg = utils.get_event_message()
     self.assertIs(type(msg.event.payload_field), bt2_field._StructureField)
示例#6
0
 def test_attr_specific_context_field(self):
     msg = utils.get_event_message()
     self.assertIs(type(msg.event.specific_context_field),
                   bt2_field._StructureField)
示例#7
0
 def test_attr_event_class(self):
     msg = utils.get_event_message()
     self.assertIs(type(msg.event.cls), bt2_event_class._EventClass)