@@ -33,7 +33,7 @@ def test_export_with_jsonall(default_matrix):
33
33
"""Check the jsonAll doesn't raise and export some additional field."""
34
34
matrix = default_matrix
35
35
out_file = io .BytesIO ()
36
- canmatrix .formats .dump (matrix , out_file , "cmjson " , jsonAll = True )
36
+ canmatrix .formats .dump (matrix , out_file , "json " , jsonAll = True )
37
37
data = out_file .getvalue ().decode ("utf-8" )
38
38
assert "my_value1" in data
39
39
assert "my_value2" in data
@@ -42,7 +42,7 @@ def test_export_with_jsonall(default_matrix):
42
42
def test_export_additional_frame_info (default_matrix ):
43
43
matrix = default_matrix
44
44
out_file = io .BytesIO ()
45
- canmatrix .formats .dump (matrix , out_file , "cmjson " , additionalFrameAttributes = "my_attribute1" )
45
+ canmatrix .formats .dump (matrix , out_file , "json " , additionalFrameAttributes = "my_attribute1" )
46
46
data = out_file .getvalue ().decode ("utf-8" )
47
47
assert "my_value1" in data
48
48
@@ -57,7 +57,7 @@ def test_export_long_signal_names():
57
57
frame .add_signal (signal )
58
58
59
59
out_file = io .BytesIO ()
60
- canmatrix .formats .dump (matrix , out_file , "cmjson " , jsonAll = True )
60
+ canmatrix .formats .dump (matrix , out_file , "json " , jsonAll = True )
61
61
data = json .loads (out_file .getvalue ().decode ("utf-8" ))
62
62
63
63
assert data ['messages' ][0 ]['signals' ][0 ]['name' ] == long_signal_name
@@ -70,7 +70,7 @@ def test_export_min_max():
70
70
frame .add_signal (signal )
71
71
matrix .add_frame (frame )
72
72
out_file = io .BytesIO ()
73
- canmatrix .formats .dump (matrix , out_file , "cmjson " , jsonAll = True )
73
+ canmatrix .formats .dump (matrix , out_file , "json " , jsonAll = True )
74
74
data = json .loads (out_file .getvalue ().decode ("utf-8" ))
75
75
assert (data ['messages' ][0 ]['signals' ][0 ]['min' ] == '-5' )
76
76
assert (data ['messages' ][0 ]['signals' ][0 ]['max' ] == '42' )
@@ -106,7 +106,7 @@ def test_import_min_max():
106
106
}
107
107
]
108
108
}"""
109
- matrix = canmatrix .formats .loads_flat (json_input , "cmjson " , jsonAll = True )
109
+ matrix = canmatrix .formats .loads_flat (json_input , "json " , jsonAll = True )
110
110
assert matrix .frames [0 ].signals [0 ].min == - 5
111
111
assert matrix .frames [0 ].signals [0 ].max == 42
112
112
@@ -140,7 +140,7 @@ def test_import_native():
140
140
}
141
141
]
142
142
}"""
143
- matrix = canmatrix .formats .loads_flat (json_input , "cmjson " , jsonAll = True )
143
+ matrix = canmatrix .formats .loads_flat (json_input , "json " , jsonAll = True )
144
144
assert matrix .frames [0 ].signals [0 ].min == - 4.2
145
145
assert matrix .frames [0 ].signals [0 ].max == 42
146
146
assert matrix .frames [0 ].signals [0 ].factor == 0.123
@@ -153,7 +153,7 @@ def test_export_native():
153
153
frame .add_signal (signal )
154
154
matrix .add_frame (frame )
155
155
out_file = io .BytesIO ()
156
- canmatrix .formats .dump (matrix , out_file , "cmjson " , jsonNativeTypes = True )
156
+ canmatrix .formats .dump (matrix , out_file , "json " , jsonNativeTypes = True )
157
157
data = json .loads (out_file .getvalue ().decode ("utf-8" ))
158
158
assert (data ['messages' ][0 ]['signals' ][0 ]['factor' ] == 0.123 )
159
159
assert (data ['messages' ][0 ]['signals' ][0 ]['offset' ] == 1 )
@@ -165,7 +165,7 @@ def test_export_all_native():
165
165
frame .add_signal (signal )
166
166
matrix .add_frame (frame )
167
167
out_file = io .BytesIO ()
168
- canmatrix .formats .dump (matrix , out_file , "cmjson " , jsonAll = True , jsonNativeTypes = True )
168
+ canmatrix .formats .dump (matrix , out_file , "json " , jsonAll = True , jsonNativeTypes = True )
169
169
data = json .loads (out_file .getvalue ().decode ("utf-8" ))
170
170
assert (data ['messages' ][0 ]['signals' ][0 ]['min' ] == - 4.2 )
171
171
assert (data ['messages' ][0 ]['signals' ][0 ]['max' ] == 42 )
0 commit comments