Update AASX (Part 5) to v3.1 - #486
Merged
s-heppner merged 2 commits intoMay 5, 2026
Merged
Conversation
Contributor
AAS Part 5 (AASX) - Implemented Changes
|
Contributor
|
Moreover, I updated:
|
s-heppner
marked this pull request as ready for review
May 5, 2026 07:55
3 tasks
s-heppner
pushed a commit
that referenced
this pull request
Jun 29, 2026
Previously compliance_tool tests relied on handcrafted examples.
Replaced examples by mocking the underlying sdk functionality to
just test the output parsing. Currently only for json and only for
'check_deserialization' and 'check_example'.
Applied the same refactoring to resulting equivalence check of json
implementation and the xml implementation.
Tests for the compliance check for aasx files were refactored so
they use mocking instead of actual files. Additional test cases
were added to ensure
1. alignment of core properties is checked
2. content of supplementary files is equal
Replace the old fixture-dependent subprocess tests with direct calls to
main() and parse_cli_arguments(), mocking compliance_check_* modules to
verify routing without touching the filesystem.
Previously the aasx file equivalence check would
1. still execute subsequent steps if the loading of one file fails.
This was caused by checking only if `state_manager.status is Status.FAILED`,
missing that `Status.NOT_EXECUTED > Status.FAILED`.
2. use blank assertions to ensure core_properties `created` attribute
is of type `datetime.datetime`.
This resulted in the compliance_tool failing with `AssertionError`
in cases that were caused by (1).
Status guards for fast-failing are now corrected to take
`Status.NOT_EXECUTED` into account.
The assertions are removed and replaced with `DataChecker` checks
to inform the user gracefully on problems. `cast(...)` is used
to inform the type-checker about the `isinstance(...)` result.
Previously the supplementary files of the aasx container were not
tested for presence or equality although the check_aas_example did
it. Now a two-way check, coparing presence, content-type and sha256
is implemented. Tests were adapted to expect the additional step.
The previous check on the supplementary file was broken, as it
compared the sha256 value of the TestFile to itself.
Introduced a new step which checks for presence and equality of
supplementary file `/TestFile.pdf` in the AASX container.
Refactored the core property checks to no longer use `assert` in
combination with `try ... except AssertionError`.
The `failed_checks` is a property that returns a fresh iterator
at each call. With `mock_data_checker.return_value.failed_checks = iter([])`
only one iterator is created that may be exhausted at subsequent calls.
The introduced `PropertyMock` fixes this.
As the new test structure uses mocking extensively, the risk for
missing error cases in these tests increases. To overcome this
simple end-to-end integration tests are integrated now, which do
not use mocking but operate on real temporary files.
For all three adapters a full cycle is implemented:
1. create -> check_example (both success and fail)
2. create x2 -> check_file_equivalence (both sucess and fail)
The help output of the compliance tool is cleaned. Old fragments
of the long ago removed schema-checking functionality were still
in place.
Fixes #486
Merged
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.