Skip to content

Commit fc99d9c

Browse files
Frosty2500s-heppner
authored andcommitted
compliance-tool: Fix compliance tool imports and unitests (#356)
Currently, there are several wrong imports and outdated unittests in the `compliance-tool` package. This fixes these issues. Fixes #354
1 parent de94f65 commit fc99d9c

File tree

20 files changed

+83
-75
lines changed

20 files changed

+83
-75
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ jobs:
191191
runs-on: ubuntu-latest
192192
strategy:
193193
matrix:
194-
python-version: ["3.8", "3.10", "3.12"]
194+
python-version: ["3.9", "3.12"]
195195
defaults:
196196
run:
197197
working-directory: ./compliance_tool
@@ -224,10 +224,10 @@ jobs:
224224
working-directory: ./compliance_tool
225225
steps:
226226
- uses: actions/checkout@v2
227-
- name: Set up Python ${{ env.X_PYTHON_VERSION }}
227+
- name: Set up Python ${{ env.X_PYTHON_MIN_VERSION }}
228228
uses: actions/setup-python@v2
229229
with:
230-
python-version: ${{ env.X_PYTHON_VERSION }}
230+
python-version: ${{ env.X_PYTHON_MIN_VERSION }}
231231
- name: Install Python dependencies
232232
run: |
233233
python -m pip install --upgrade pip
@@ -249,10 +249,10 @@ jobs:
249249
working-directory: ./compliance_tool
250250
steps:
251251
- uses: actions/checkout@v2
252-
- name: Set up Python ${{ env.X_PYTHON_VERSION }}
252+
- name: Set up Python ${{ env.X_PYTHON_MIN_VERSION }}
253253
uses: actions/setup-python@v2
254254
with:
255-
python-version: ${{ env.X_PYTHON_VERSION }}
255+
python-version: ${{ env.X_PYTHON_MIN_VERSION }}
256256
- name: Install Python dependencies
257257
run: |
258258
python -m pip install --upgrade pip
@@ -277,10 +277,10 @@ jobs:
277277
working-directory: ./compliance_tool
278278
steps:
279279
- uses: actions/checkout@v2
280-
- name: Set up Python ${{ env.X_PYTHON_VERSION }}
280+
- name: Set up Python ${{ env.X_PYTHON_MIN_VERSION }}
281281
uses: actions/setup-python@v2
282282
with:
283-
python-version: ${{ env.X_PYTHON_VERSION }}
283+
python-version: ${{ env.X_PYTHON_MIN_VERSION }}
284284
- name: Install dependencies
285285
run: |
286286
python -m pip install --upgrade pip
File renamed without changes.

compliance_tool/aas_compliance_tool/cli.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2020 the Eclipse BaSyx Authors
1+
# Copyright (c) 2024 the Eclipse BaSyx Authors
22
#
33
# This program and the accompanying materials are made available under the terms of the MIT License, available in
44
# the LICENSE file of this project.
@@ -19,11 +19,12 @@
1919

2020
from basyx.aas.adapter import aasx
2121
from basyx.aas.adapter.xml import write_aas_xml_file
22-
from basyx.aas.compliance_tool import compliance_check_xml as compliance_tool_xml, \
23-
compliance_check_json as compliance_tool_json, compliance_check_aasx as compliance_tool_aasx
22+
from aas_compliance_tool import compliance_check_xml as compliance_tool_xml, \
23+
compliance_check_json as compliance_tool_json, \
24+
compliance_check_aasx as compliance_tool_aasx
2425
from basyx.aas.adapter.json import write_aas_json_file
2526
from basyx.aas.examples.data import create_example, create_example_aas_binding, TEST_PDF_FILE
26-
from basyx.aas.compliance_tool.state_manager import ComplianceToolStateManager, Status
27+
from aas_compliance_tool.state_manager import ComplianceToolStateManager, Status
2728

2829

2930
def parse_cli_arguments() -> argparse.ArgumentParser:

compliance_tool/aas_compliance_tool/compliance_check_aasx.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2020 the Eclipse BaSyx Authors
1+
# Copyright (c) 2024 the Eclipse BaSyx Authors
22
#
33
# This program and the accompanying materials are made available under the terms of the MIT License, available in
44
# the LICENSE file of this project.
@@ -19,14 +19,14 @@
1919

2020
import pyecma376_2
2121

22-
from . import compliance_check_json, compliance_check_xml
22+
from aas_compliance_tool import compliance_check_json, compliance_check_xml
2323
from basyx.aas import model
2424
from basyx.aas.adapter import aasx
2525
from basyx.aas.adapter.xml import xml_deserialization
2626
from basyx.aas.adapter.json import json_deserialization
2727
from basyx.aas.examples.data import example_aas, create_example_aas_binding
2828
from basyx.aas.examples.data._helper import AASDataChecker, DataChecker
29-
from .state_manager import ComplianceToolStateManager, Status
29+
from aas_compliance_tool.state_manager import ComplianceToolStateManager, Status
3030

3131

3232
def check_deserialization(file_path: str, state_manager: ComplianceToolStateManager,

compliance_tool/aas_compliance_tool/compliance_check_json.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2020 the Eclipse BaSyx Authors
1+
# Copyright (c) 2024 the Eclipse BaSyx Authors
22
#
33
# This program and the accompanying materials are made available under the terms of the MIT License, available in
44
# the LICENSE file of this project.
@@ -20,7 +20,7 @@
2020
from basyx.aas.adapter.json import json_deserialization
2121
from basyx.aas.examples.data import example_aas, create_example
2222
from basyx.aas.examples.data._helper import AASDataChecker
23-
from .state_manager import ComplianceToolStateManager, Status
23+
from aas_compliance_tool.state_manager import ComplianceToolStateManager, Status
2424

2525

2626
JSON_SCHEMA_FILE = os.path.join(os.path.dirname(__file__), 'schemas/aasJSONSchema.json')

compliance_tool/aas_compliance_tool/compliance_check_xml.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2020 the Eclipse BaSyx Authors
1+
# Copyright (c) 2024 the Eclipse BaSyx Authors
22
#
33
# This program and the accompanying materials are made available under the terms of the MIT License, available in
44
# the LICENSE file of this project.
@@ -20,7 +20,7 @@
2020
from basyx.aas.adapter.xml import xml_deserialization
2121
from basyx.aas.examples.data import example_aas, create_example
2222
from basyx.aas.examples.data._helper import AASDataChecker
23-
from .state_manager import ComplianceToolStateManager, Status
23+
from aas_compliance_tool.state_manager import ComplianceToolStateManager, Status
2424

2525

2626
XML_SCHEMA_FILE = os.path.join(os.path.dirname(__file__), 'schemas/aasXMLSchema.xsd')

compliance_tool/aas_compliance_tool/state_manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2020 the Eclipse BaSyx Authors
1+
# Copyright (c) 2024 the Eclipse BaSyx Authors
22
#
33
# This program and the accompanying materials are made available under the terms of the MIT License, available in
44
# the LICENSE file of this project.

compliance_tool/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env python3
2-
# Copyright (c) 2019-2021 the Eclipse BaSyx Authors
2+
# Copyright (c) 2024-2021 the Eclipse BaSyx Authors
33
#
44
# This program and the accompanying materials are made available under the terms of the MIT License, available in
55
# the LICENSE file of this project.

compliance_tool/test/files/test_demo_full_example.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@
499499
},
500500
{
501501
"language": "de",
502-
"text": "Ein Beispiel-BillofMaterial-Submodel f\u00fcr eine Test-Anwendung"
502+
"text": "Ein Beispiel-BillOfMaterial-Submodel f\u00fcr eine Test-Anwendung"
503503
}
504504
],
505505
"modelType": "Submodel",
@@ -1309,7 +1309,7 @@
13091309
},
13101310
{
13111311
"language": "de",
1312-
"text": "Beispielswert f\u00fcr ein MulitLanguageProperty-Element"
1312+
"text": "Beispielwert f\u00fcr ein MultiLanguageProperty-Element"
13131313
}
13141314
],
13151315
"valueId": {
@@ -2281,7 +2281,7 @@
22812281
},
22822282
{
22832283
"language": "de",
2284-
"text": "Beispiel MulitLanguageProperty Element"
2284+
"text": "Beispiel MultiLanguageProperty Element"
22852285
}
22862286
],
22872287
"modelType": "MultiLanguageProperty",
@@ -2301,7 +2301,7 @@
23012301
},
23022302
{
23032303
"language": "de",
2304-
"text": "Beispielswert f\u00fcr ein MulitLanguageProperty-Element"
2304+
"text": "Beispielwert f\u00fcr ein MultiLanguageProperty-Element"
23052305
}
23062306
]
23072307
},
@@ -2825,7 +2825,7 @@
28252825
},
28262826
{
28272827
"language": "de",
2828-
"text": "Beispiel MulitLanguageProperty Element"
2828+
"text": "Beispiel MultiLanguageProperty Element"
28292829
}
28302830
],
28312831
"modelType": "MultiLanguageProperty",

compliance_tool/test/files/test_demo_full_example.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@
486486
</aas:langStringTextType>
487487
<aas:langStringTextType>
488488
<aas:language>de</aas:language>
489-
<aas:text>Ein Beispiel-BillofMaterial-Submodel für eine Test-Anwendung</aas:text>
489+
<aas:text>Ein Beispiel-BillOfMaterial-Submodel für eine Test-Anwendung</aas:text>
490490
</aas:langStringTextType>
491491
</aas:description>
492492
<aas:administration>
@@ -1424,7 +1424,7 @@
14241424
</aas:langStringTextType>
14251425
<aas:langStringTextType>
14261426
<aas:language>de</aas:language>
1427-
<aas:text>Beispielswert für ein MulitLanguageProperty-Element</aas:text>
1427+
<aas:text>Beispielwert für ein MultiLanguageProperty-Element</aas:text>
14281428
</aas:langStringTextType>
14291429
</aas:value>
14301430
<aas:valueId>
@@ -2109,7 +2109,7 @@
21092109
</aas:langStringTextType>
21102110
<aas:langStringTextType>
21112111
<aas:language>de</aas:language>
2112-
<aas:text>Beispiel MulitLanguageProperty Element</aas:text>
2112+
<aas:text>Beispiel MultiLanguageProperty Element</aas:text>
21132113
</aas:langStringTextType>
21142114
</aas:description>
21152115
<aas:semanticId>
@@ -2128,7 +2128,7 @@
21282128
</aas:langStringTextType>
21292129
<aas:langStringTextType>
21302130
<aas:language>de</aas:language>
2131-
<aas:text>Beispielswert für ein MulitLanguageProperty-Element</aas:text>
2131+
<aas:text>Beispielwert für ein MultiLanguageProperty-Element</aas:text>
21322132
</aas:langStringTextType>
21332133
</aas:value>
21342134
</aas:multiLanguageProperty>
@@ -2632,7 +2632,7 @@
26322632
</aas:langStringTextType>
26332633
<aas:langStringTextType>
26342634
<aas:language>de</aas:language>
2635-
<aas:text>Beispiel MulitLanguageProperty Element</aas:text>
2635+
<aas:text>Beispiel MultiLanguageProperty Element</aas:text>
26362636
</aas:langStringTextType>
26372637
</aas:description>
26382638
<aas:semanticId>

0 commit comments

Comments
 (0)