Package: aas-test-engines
Test Engines for the Asset Administration ShellThe Asset Administration Shell (AAS) is a standard for Digital Twins.
More information can be foundhere.The tools in this repository offer measures to validate compliance of AAS implementations against the AAS standard.InstallationYou can install the AAS Test Engines via pip:python-mpipinstallaas_test_enginesCheck AAS Type 1 (File)Check AASX:fromaas_test_enginesimportfilefromxml.etreeimportElementTreewithopen('aas.aasx')asf:result=file.check_aasx_file(f)# result.ok() == Trueresult.dump()Check JSON:fromaas_test_enginesimportfile# Check filewithopen('aas.json')asf:result=file.check_json_file(f)# result.ok() == True# Or check data directlyaas={'assetAdministrationShells':[],'submodels':[],'conceptDescriptions':[]}result=file.check_json_data(aas)# result.ok() == Trueresult.dump()Check XML:fromaas_test_enginesimportfilefromxml.etreeimportElementTree# Check filewithopen('aas.xml')asf:result=file.check_xml_file(f)# result.ok() == True# Or check data directlydata=ElementTree.fromstring('<environment xmlns="https://admin-shell.io/aas/3/0" />')result=file.check_xml_data(aas)# result.ok() == Trueresult.dump()Checking older versionsBy default, thefile.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:fromaas_test_enginesimportfileprint(file.supported_versions())print(file.latest_version())Check AAS Type 2 (HTTP API)Check a running server instancefromaas_test_enginesimportapitests=api.generate_tests()# Check an instanceapi.execute_tests(tests,"http://localhost")# Check another instanceapi.execute_tests(tests,"http://localhost:3000")Checking older versions and specific test suitesBy default, theapi.generate_testsmethod 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:fromaas_test_enginesimportapitests=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:fromaas_test_enginesimportapiprint(api.supported_versions())print(api.latest_version())For version 1.0RC03 the following test suites are available:API NameTest Suite ReadTest Suite Read and WriteAsset Administration Shell APIaas_readaasSubmodel APIsubmodel_readsubmodelAASX File Server APIaasx_readaasxAsset Administration Shell Registry APIaas_registry_readaas_registrySubmodel Registry APIsubmodel_registry_readsubmodel_registryAsset Administration Shell Repository APIaas_repository_readaas_repositorySubmodel Repository APIsubmodel_repository_readsubmodel_repositoryConcept Description Repository APIconcept_description_repository_readconcept_description_repositoryAsset Administration Shell Basic Discovery APIaas_discovery_readaas_discvoerySerialization APIserialization-Description APIdescription-Command line interfaceYou may want to invoke the test tools using the simplified command line interface:# Check filepython-maas_test_enginesfiletest.aasx# Check serverpython-maas_test_enginesapihttps://localhost--suiteregistry