Skip to content

Commit 571d9ab

Browse files
committed
Fix support for autosar 25-11
The version string Autosar_00054 was not accepted
1 parent db8ab9d commit 571d9ab

3 files changed

Lines changed: 14 additions & 5 deletions

File tree

src/version.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ pub(crate) enum AutosarVersion {
4848
Autosar_00052,
4949
#[pyo3(name = "AUTOSAR_00053")]
5050
Autosar_00053,
51+
#[pyo3(name = "AUTOSAR_00054")]
52+
Autosar_00054,
5153
#[pyo3(name = "LATEST")]
5254
Latest,
5355
}
@@ -95,6 +97,7 @@ impl From<AutosarVersion> for autosar_data_specification::AutosarVersion {
9597
AutosarVersion::Autosar_00051 => Self::Autosar_00051,
9698
AutosarVersion::Autosar_00052 => Self::Autosar_00052,
9799
AutosarVersion::Autosar_00053 => Self::Autosar_00053,
100+
AutosarVersion::Autosar_00054 => Self::Autosar_00054,
98101
AutosarVersion::Latest => Self::LATEST,
99102
}
100103
}
@@ -124,8 +127,9 @@ impl From<autosar_data_specification::AutosarVersion> for AutosarVersion {
124127
autosar_data_specification::AutosarVersion::Autosar_00051 => Self::Autosar_00051,
125128
autosar_data_specification::AutosarVersion::Autosar_00052 => Self::Autosar_00052,
126129
autosar_data_specification::AutosarVersion::Autosar_00053 => Self::Autosar_00053,
130+
autosar_data_specification::AutosarVersion::Autosar_00054 => Self::Autosar_00054,
127131

128-
_ => Self::Autosar_00053,
132+
_ => Self::Autosar_00054,
129133
}
130134
}
131135
}

test/model_test.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -210,13 +210,13 @@ def test_model_misc() -> None:
210210
assert model.root_element.model == model
211211
# inequalities do not exist
212212
with pytest.raises(TypeError):
213-
model < model2
213+
model < model2 # type: ignore [arg-type]
214214
with pytest.raises(TypeError):
215-
model > model2
215+
model > model2 # type: ignore [arg-type]
216216
with pytest.raises(TypeError):
217-
model <= model2
217+
model <= model2 # type: ignore [arg-type]
218218
with pytest.raises(TypeError):
219-
model >= model2
219+
model >= model2 # type: ignore [arg-type]
220220

221221
# models can be hashed
222222
modelset = set([model, model2])

test/version_test.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,11 @@ def test_version() -> None:
111111
arxmlfile = model.create_file("AUTOSAR_00053.arxml", ver)
112112
assert arxmlfile.version == ver
113113

114+
ver = AutosarVersion("AUTOSAR_00054.xsd")
115+
assert ver == AutosarVersion.AUTOSAR_00054
116+
arxmlfile = model.create_file("AUTOSAR_00054.arxml", ver)
117+
assert arxmlfile.version == ver
118+
114119
with pytest.raises(AutosarDataError):
115120
ver = AutosarVersion("bad.xsd")
116121

0 commit comments

Comments
 (0)