-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
71 support more top level messages (#74)
* Add more message types * Fix double version schema bug * Update osi to current master * Change osi requirement to current master * Add remaining message types and unit tests --------- Signed-off-by: ClemensLinnhoff <clemens.linnhoff@partner.bmw.de>
- Loading branch information
1 parent
b6e642a
commit 160aea1
Showing
5 changed files
with
97 additions
and
4 deletions.
There are no files selected for viewing
Submodule open-simulation-interface
updated
5 files
+1 −1 | doc/architecture/architecture_overview.adoc | |
+19 −7 | doc/architecture/trace_file_naming.adoc | |
+1 −1 | osi3trace/osi2read.py | |
+19 −0 | osi3trace/osi_trace.py | |
+517 −7 | tests/test_osi_trace.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import unittest | ||
from osivalidator.osi_general_validator import detect_message_type | ||
|
||
|
||
class TestDetectMessageType(unittest.TestCase): | ||
def test_detect_message_type_sensor_data(self): | ||
path = "path/to/file_sd_123.osi" | ||
message_type = detect_message_type(path) | ||
self.assertEqual(message_type, "SensorData") | ||
|
||
def test_detect_message_type_sensor_view(self): | ||
path = "path/to/file_sv_123.osi" | ||
message_type = detect_message_type(path) | ||
self.assertEqual(message_type, "SensorView") | ||
|
||
def test_detect_message_type_sensor_view_config(self): | ||
path = "path/to/file_svc_123.osi" | ||
message_type = detect_message_type(path) | ||
self.assertEqual(message_type, "SensorViewConfiguration") | ||
|
||
def test_detect_message_type_ground_truth(self): | ||
path = "path/to/file_gt_123.osi" | ||
message_type = detect_message_type(path) | ||
self.assertEqual(message_type, "GroundTruth") | ||
|
||
def test_detect_message_type_traffic_update(self): | ||
path = "path/to/file_tu_123.osi" | ||
message_type = detect_message_type(path) | ||
self.assertEqual(message_type, "TrafficUpdate") | ||
|
||
def test_detect_message_type_traffic_command_update(self): | ||
path = "path/to/file_tcu_123.osi" | ||
message_type = detect_message_type(path) | ||
self.assertEqual(message_type, "TrafficCommandUpdate") | ||
|
||
def test_detect_message_type_traffic_command(self): | ||
path = "path/to/file_tc_123.osi" | ||
message_type = detect_message_type(path) | ||
self.assertEqual(message_type, "TrafficCommand") | ||
|
||
def test_detect_message_type_host_vehicle_data(self): | ||
path = "path/to/file_hvd_123.osi" | ||
message_type = detect_message_type(path) | ||
self.assertEqual(message_type, "HostVehicleData") | ||
|
||
def test_detect_message_type_motion_request(self): | ||
path = "path/to/file_mr_123.osi" | ||
message_type = detect_message_type(path) | ||
self.assertEqual(message_type, "MotionRequest") | ||
|
||
def test_detect_message_type_streaming_update(self): | ||
path = "path/to/file_su_123.osi" | ||
message_type = detect_message_type(path) | ||
self.assertEqual(message_type, "StreamingUpdate") | ||
|
||
def test_detect_message_type_unknown(self): | ||
path = "path/to/unknown_file.osi" | ||
message_type = detect_message_type(path) | ||
self.assertEqual(message_type, "SensorView") | ||
|
||
def test_detect_message_type_empty_path(self): | ||
path = "" | ||
message_type = detect_message_type(path) | ||
self.assertEqual(message_type, "SensorView") | ||
|
||
|
||
if __name__ == "__main__": | ||
unittest.main() |