@@ -26,7 +26,10 @@ def test_osi_trace_sv(self):
2626 trace = OSITrace (path_input )
2727 with open (path_output , "wt" ) as f :
2828 for message in trace :
29+ self .assertIsInstance (message , SensorView )
2930 f .write (str (message ))
31+
32+ self .assertEqual (len (trace .retrieve_offsets ()), 10 )
3033 trace .close ()
3134
3235 self .assertTrue (os .path .exists (path_output ))
@@ -40,7 +43,10 @@ def test_osi_trace_gt(self):
4043 trace = OSITrace (path_input , "GroundTruth" )
4144 with open (path_output , "wt" ) as f :
4245 for message in trace :
46+ self .assertIsInstance (message , GroundTruth )
4347 f .write (str (message ))
48+
49+ self .assertEqual (len (trace .retrieve_offsets ()), 10 )
4450 trace .close ()
4551
4652 self .assertTrue (os .path .exists (path_output ))
@@ -54,7 +60,10 @@ def test_osi_trace_sd(self):
5460 trace = OSITrace (path_input , "SensorData" )
5561 with open (path_output , "wt" ) as f :
5662 for message in trace :
63+ self .assertIsInstance (message , SensorData )
5764 f .write (str (message ))
65+
66+ self .assertEqual (len (trace .retrieve_offsets ()), 10 )
5867 trace .close ()
5968
6069 self .assertTrue (os .path .exists (path_output ))
@@ -68,7 +77,10 @@ def test_osi_trace_svc(self):
6877 trace = OSITrace (path_input , "SensorViewConfiguration" )
6978 with open (path_output , "wt" ) as f :
7079 for message in trace :
80+ self .assertIsInstance (message , SensorViewConfiguration )
7181 f .write (str (message ))
82+
83+ self .assertEqual (len (trace .retrieve_offsets ()), 1 )
7284 trace .close ()
7385
7486 self .assertTrue (os .path .exists (path_output ))
@@ -82,7 +94,10 @@ def test_osi_trace_tu(self):
8294 trace = OSITrace (path_input , "TrafficUpdate" )
8395 with open (path_output , "wt" ) as f :
8496 for message in trace :
97+ self .assertIsInstance (message , TrafficUpdate )
8598 f .write (str (message ))
99+
100+ self .assertEqual (len (trace .retrieve_offsets ()), 10 )
86101 trace .close ()
87102
88103 self .assertTrue (os .path .exists (path_output ))
@@ -96,7 +111,10 @@ def test_osi_trace_tc(self):
96111 trace = OSITrace (path_input , "TrafficCommand" )
97112 with open (path_output , "wt" ) as f :
98113 for message in trace :
114+ self .assertIsInstance (message , TrafficCommand )
99115 f .write (str (message ))
116+
117+ self .assertEqual (len (trace .retrieve_offsets ()), 10 )
100118 trace .close ()
101119
102120 self .assertTrue (os .path .exists (path_output ))
@@ -110,7 +128,10 @@ def test_osi_trace_tcu(self):
110128 trace = OSITrace (path_input , "TrafficCommandUpdate" )
111129 with open (path_output , "wt" ) as f :
112130 for message in trace :
131+ self .assertIsInstance (message , TrafficCommandUpdate )
113132 f .write (str (message ))
133+
134+ self .assertEqual (len (trace .retrieve_offsets ()), 10 )
114135 trace .close ()
115136
116137 self .assertTrue (os .path .exists (path_output ))
@@ -124,7 +145,10 @@ def test_osi_trace_mr(self):
124145 trace = OSITrace (path_input , "MotionRequest" )
125146 with open (path_output , "wt" ) as f :
126147 for message in trace :
148+ self .assertIsInstance (message , MotionRequest )
127149 f .write (str (message ))
150+
151+ self .assertEqual (len (trace .retrieve_offsets ()), 10 )
128152 trace .close ()
129153
130154 self .assertTrue (os .path .exists (path_output ))
@@ -138,7 +162,10 @@ def test_osi_trace_su(self):
138162 trace = OSITrace (path_input , "StreamingUpdate" )
139163 with open (path_output , "wt" ) as f :
140164 for message in trace :
165+ self .assertIsInstance (message , StreamingUpdate )
141166 f .write (str (message ))
167+
168+ self .assertEqual (len (trace .retrieve_offsets ()), 10 )
142169 trace .close ()
143170
144171 self .assertTrue (os .path .exists (path_output ))
0 commit comments