Official test tooling for the Asset Administration Shell
Project description
Test Engines for the Asset Administration Shell
The Asset Administration Shell (AAS) is a standard for Digital Twins. More information can be found here.
The tools in this repository offer measures to validate compliance of AAS implementations against the AAS standard.
Installation
You can install the AAS Test Engines via pip:
python -m pip install aas_test_engines
Check AAS Type 1 (File)
Check AASX:
from aas_test_engines import file
from xml.etree import ElementTree
with open('aas.aasx') as f:
result = file.check_aasx_file(f)
# result.ok() == True
result.dump()
Check JSON:
from aas_test_engines import file
# Check file
with open('aas.json') as f:
result = file.check_json_file(f)
# result.ok() == True
# Or check data directly
aas = {
'assetAdministrationShells': [],
'submodels': [],
'conceptDescriptions': []
}
result = file.check_json_data(aas)
# result.ok() == True
result.dump()
Check XML:
from aas_test_engines import file
from xml.etree import ElementTree
# Check file
with open('aas.xml') as f:
result = file.check_xml_file(f)
# result.ok() == True
# Or check data directly
data = ElementTree.fromstring(
'<environment xmlns="https://admin-shell.io/aas/3/0" />')
result = file.check_xml_data(aas)
# result.ok() == True
result.dump()
Checking older versions
By default, the file.check...
methods check compliance to version 3.0 of the standard.
You may want to check against older versions by passing a string containing the version to these methods.
You can query the list of supported versions as follows:
from aas_test_engines import file
print(file.supported_versions())
print(file.latest_version())
Check AAS Type 2 (HTTP API)
Check a running server instance
from aas_test_engines import api
tests = api.generate_tests()
# Check an instance
api.execute_tests(tests, "http://localhost")
# Check another instance
api.execute_tests(tests, "http://localhost:3000")
Checking older versions and specific test suites
By default, the api.generate_tests
method generate test cases for version 3.0 of the standard and all associated test suites.
You may want to check against older versions by passing a string containing the version to these methods.
You can also provide a list of test suites to check against:
from aas_test_engines import api
tests = api.generate_tests('1.0RC03', ['repository'])
api.execute_tests(tests, "http://localhost")
You can query the list of supported versions and their associated test suites as follows:
from aas_test_engines import api
print(api.supported_versions())
print(api.latest_version())
For version 1.0RC03 the following test suites are available:
API Name | Test Suite Read | Test Suite Read and Write |
---|---|---|
Asset Administration Shell API | aas_read | aas |
Submodel API | submodel_read | submodel |
AASX File Server API | aasx_read | aasx |
Asset Administration Shell Registry API | aas_registry_read | aas_registry |
Submodel Registry API | submodel_registry_read | submodel_registry |
Asset Administration Shell Repository API | aas_repository_read | aas_repository |
Submodel Repository API | submodel_repository_read | submodel_repository |
Concept Description Repository API | concept_description_repository_read | concept_description_repository |
Asset Administration Shell Basic Discovery API | aas_discovery_read | aas_discvoery |
Serialization API | serialization | - |
Description API | description | - |
Command line interface
You may want to invoke the test tools using the simplified command line interface:
# Check file
python -m aas_test_engines file test.aasx
# Check server
python -m aas_test_engines api https://localhost --suite registry
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for aas_test_engines-0.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f7b03e7910639b985a3ab91a4276d6d19bf14a3786b7af784e24995cb3ee001 |
|
MD5 | 760be3157cad92d28bd05d0639cea48f |
|
BLAKE2b-256 | 9f93eea884ca044d1421aa50df12d526a969a6cb97d39babdd304f5b83bfc8ea |