@@ -26,7 +26,10 @@ def test_osi_trace_sv(self):
26
26
trace = OSITrace (path_input )
27
27
with open (path_output , "wt" ) as f :
28
28
for message in trace :
29
+ self .assertIsInstance (message , SensorView )
29
30
f .write (str (message ))
31
+
32
+ self .assertEqual (len (trace .retrieve_offsets ()), 10 )
30
33
trace .close ()
31
34
32
35
self .assertTrue (os .path .exists (path_output ))
@@ -40,7 +43,10 @@ def test_osi_trace_gt(self):
40
43
trace = OSITrace (path_input , "GroundTruth" )
41
44
with open (path_output , "wt" ) as f :
42
45
for message in trace :
46
+ self .assertIsInstance (message , GroundTruth )
43
47
f .write (str (message ))
48
+
49
+ self .assertEqual (len (trace .retrieve_offsets ()), 10 )
44
50
trace .close ()
45
51
46
52
self .assertTrue (os .path .exists (path_output ))
@@ -54,7 +60,10 @@ def test_osi_trace_sd(self):
54
60
trace = OSITrace (path_input , "SensorData" )
55
61
with open (path_output , "wt" ) as f :
56
62
for message in trace :
63
+ self .assertIsInstance (message , SensorData )
57
64
f .write (str (message ))
65
+
66
+ self .assertEqual (len (trace .retrieve_offsets ()), 10 )
58
67
trace .close ()
59
68
60
69
self .assertTrue (os .path .exists (path_output ))
@@ -68,7 +77,10 @@ def test_osi_trace_svc(self):
68
77
trace = OSITrace (path_input , "SensorViewConfiguration" )
69
78
with open (path_output , "wt" ) as f :
70
79
for message in trace :
80
+ self .assertIsInstance (message , SensorViewConfiguration )
71
81
f .write (str (message ))
82
+
83
+ self .assertEqual (len (trace .retrieve_offsets ()), 1 )
72
84
trace .close ()
73
85
74
86
self .assertTrue (os .path .exists (path_output ))
@@ -82,7 +94,10 @@ def test_osi_trace_tu(self):
82
94
trace = OSITrace (path_input , "TrafficUpdate" )
83
95
with open (path_output , "wt" ) as f :
84
96
for message in trace :
97
+ self .assertIsInstance (message , TrafficUpdate )
85
98
f .write (str (message ))
99
+
100
+ self .assertEqual (len (trace .retrieve_offsets ()), 10 )
86
101
trace .close ()
87
102
88
103
self .assertTrue (os .path .exists (path_output ))
@@ -96,7 +111,10 @@ def test_osi_trace_tc(self):
96
111
trace = OSITrace (path_input , "TrafficCommand" )
97
112
with open (path_output , "wt" ) as f :
98
113
for message in trace :
114
+ self .assertIsInstance (message , TrafficCommand )
99
115
f .write (str (message ))
116
+
117
+ self .assertEqual (len (trace .retrieve_offsets ()), 10 )
100
118
trace .close ()
101
119
102
120
self .assertTrue (os .path .exists (path_output ))
@@ -110,7 +128,10 @@ def test_osi_trace_tcu(self):
110
128
trace = OSITrace (path_input , "TrafficCommandUpdate" )
111
129
with open (path_output , "wt" ) as f :
112
130
for message in trace :
131
+ self .assertIsInstance (message , TrafficCommandUpdate )
113
132
f .write (str (message ))
133
+
134
+ self .assertEqual (len (trace .retrieve_offsets ()), 10 )
114
135
trace .close ()
115
136
116
137
self .assertTrue (os .path .exists (path_output ))
@@ -124,7 +145,10 @@ def test_osi_trace_mr(self):
124
145
trace = OSITrace (path_input , "MotionRequest" )
125
146
with open (path_output , "wt" ) as f :
126
147
for message in trace :
148
+ self .assertIsInstance (message , MotionRequest )
127
149
f .write (str (message ))
150
+
151
+ self .assertEqual (len (trace .retrieve_offsets ()), 10 )
128
152
trace .close ()
129
153
130
154
self .assertTrue (os .path .exists (path_output ))
@@ -138,7 +162,10 @@ def test_osi_trace_su(self):
138
162
trace = OSITrace (path_input , "StreamingUpdate" )
139
163
with open (path_output , "wt" ) as f :
140
164
for message in trace :
165
+ self .assertIsInstance (message , StreamingUpdate )
141
166
f .write (str (message ))
167
+
168
+ self .assertEqual (len (trace .retrieve_offsets ()), 10 )
142
169
trace .close ()
143
170
144
171
self .assertTrue (os .path .exists (path_output ))
0 commit comments