X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=tests%2Fbindings%2Fpython%2Fbt2%2Ftest_packet.py;h=250ac466c55dc4aa07aecadb3a6cd78fe9bdcaab;hb=57081273d1191fc79edc101af619fab96b72460d;hp=2945f49b56f2e300f7e8ebb51a27198d2ee5d197;hpb=26fc5aedf48df3f1654fe4d0b6ada1a10cd804f2;p=babeltrace.git diff --git a/tests/bindings/python/bt2/test_packet.py b/tests/bindings/python/bt2/test_packet.py index 2945f49b..250ac466 100644 --- a/tests/bindings/python/bt2/test_packet.py +++ b/tests/bindings/python/bt2/test_packet.py @@ -16,7 +16,6 @@ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # -from collections import OrderedDict import unittest from utils import run_in_component_init @@ -33,42 +32,44 @@ class PacketTestCase(unittest.TestCase): # stream event context sec = tc.create_structure_field_class() - sec += OrderedDict(( + sec += [ ('cpu_id', tc.create_signed_integer_field_class(8)), ('stuff', tc.create_real_field_class()), - )) + ] # packet context pc = None if with_pc: pc = tc.create_structure_field_class() - pc += OrderedDict(( + pc += [ ('something', tc.create_signed_integer_field_class(8)), ('something_else', tc.create_real_field_class()), ('events_discarded', tc.create_unsigned_integer_field_class(64)), ('packet_seq_num', tc.create_unsigned_integer_field_class(64)), - )) + ] # stream class - sc = tc.create_stream_class(default_clock_class=clock_class, - event_common_context_field_class=sec, - packet_context_field_class=pc, - supports_packets=True) + sc = tc.create_stream_class( + default_clock_class=clock_class, + event_common_context_field_class=sec, + packet_context_field_class=pc, + supports_packets=True, + ) # event context ec = tc.create_structure_field_class() - ec += OrderedDict(( + ec += [ ('ant', tc.create_signed_integer_field_class(16)), ('msg', tc.create_string_field_class()), - )) + ] # event payload ep = tc.create_structure_field_class() - ep += OrderedDict(( + ep += [ ('giraffe', tc.create_signed_integer_field_class(32)), ('gnu', tc.create_signed_integer_field_class(8)), ('mosquito', tc.create_signed_integer_field_class(8)), - )) + ] # event class event_class = sc.create_event_class(name='ec', payload_field_class=ep)