aas-test-engines


Nameaas-test-engines JSON
Version 0.4.0 PyPI version JSON
download
home_pageNone
SummaryOfficial test tooling for the Asset Administration Shell
upload_time2024-04-18 21:30:30
maintainerNone
docs_urlNone
authorNone
requires_python>=3.6
licenseNone
keywords asset administration shell aas test
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Test Engines for the Asset Administration Shell

[![Tests](https://github.com/admin-shell-io/aas-test-engines/actions/workflows/check.yml/badge.svg)](https://github.com/admin-shell-io/aas-test-engines/actions/workflows/check.yml)

The Asset Administration Shell (AAS) is a standard for Digital Twins.
More information can be found [here](https://industrialdigitaltwin.org/content-hub/downloads).

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:

```sh
python -m pip install aas_test_engines
```

## Check AAS Type 1 (File)

### Check AASX:
```python
from aas_test_engines import file
from xml.etree import ElementTree

with open('aas.aasx', 'rb') as f:
    result = file.check_aasx_file(f)
# result.ok() == True

result.dump()
# try result.to_html() to get an interactive representation
```

### Check JSON:

```python
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:
```python
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:

```python
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

```python
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:

```python
from aas_test_engines import api

tests = api.generate_tests('3.0', ['Asset Administration Shell API'])
api.execute_tests(tests, "http://localhost")
```

For the naming of test suites we follow the names given by the specification. These are:
* **APIs:** Asset Administration Shell API, Submodel API, ...
* **Service Specifications:** Asset Administration Shell Service Specification, Submodel Service Specification, ...
* **Profiles:**  AssetAdministrationShellServiceSpecification/SSP-001, ...

You can query the list of supported versions and their associated test suites as follows:

```python
from aas_test_engines import api

print(api.supported_versions())
print(api.latest_version())
```

## Generating test data for software testing

If you develop an AAS application like an AAS editor you may want to use test data to verify correctness of your application.
The test engines allow to generate a set of AAS files which are compliant with the standard and you can therefore use to assess your application as follows:

```python
from aas_test_engines import file

for sample in file.generate():
    print(sample) # or whatever you want to do with it
```

## Command line interface

You may want to invoke the test tools using the simplified command line interface:

```sh
# Check file
python -m aas_test_engines check_file test.aasx

# Check server
python -m aas_test_engines check_server https://localhost --suite 'Asset Administration Shell API'

# Generate test data
python -m aas_test_engines generate_files output_dir
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "aas-test-engines",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": "asset administration shell, aas, test",
    "author": null,
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/71/e9/c94feea91cad295bedd1c3e287f82e5110c1472b1425d5c6aafae642d41c/aas_test_engines-0.4.0.tar.gz",
    "platform": null,
    "description": "# Test Engines for the Asset Administration Shell\n\n[![Tests](https://github.com/admin-shell-io/aas-test-engines/actions/workflows/check.yml/badge.svg)](https://github.com/admin-shell-io/aas-test-engines/actions/workflows/check.yml)\n\nThe Asset Administration Shell (AAS) is a standard for Digital Twins.\nMore information can be found [here](https://industrialdigitaltwin.org/content-hub/downloads).\n\nThe tools in this repository offer measures to validate compliance of AAS implementations against the AAS standard.\n\n## Installation\n\nYou can install the AAS Test Engines via pip:\n\n```sh\npython -m pip install aas_test_engines\n```\n\n## Check AAS Type 1 (File)\n\n### Check AASX:\n```python\nfrom aas_test_engines import file\nfrom xml.etree import ElementTree\n\nwith open('aas.aasx', 'rb') as f:\n    result = file.check_aasx_file(f)\n# result.ok() == True\n\nresult.dump()\n# try result.to_html() to get an interactive representation\n```\n\n### Check JSON:\n\n```python\nfrom aas_test_engines import file\n\n# Check file\nwith open('aas.json') as f:\n    result = file.check_json_file(f)\n# result.ok() == True\n\n# Or check data directly\naas = {\n    'assetAdministrationShells': [],\n    'submodels': [],\n    'conceptDescriptions': []\n}\nresult = file.check_json_data(aas)\n# result.ok() == True\n\nresult.dump()\n```\n\n### Check XML:\n```python\nfrom aas_test_engines import file\nfrom xml.etree import ElementTree\n\n# Check file\nwith open('aas.xml') as f:\n    result = file.check_xml_file(f)\n# result.ok() == True\n\n# Or check data directly\ndata = ElementTree.fromstring(\n    '<environment xmlns=\"https://admin-shell.io/aas/3/0\" />')\nresult = file.check_xml_data(aas)\n# result.ok() == True\n\nresult.dump()\n```\n\n### Checking older versions\n\nBy default, the `file.check...` methods check compliance to version 3.0 of the standard.\nYou may want to check against older versions by passing a string containing the version to these methods.\n\nYou can query the list of supported versions as follows:\n\n```python\nfrom aas_test_engines import file\n\nprint(file.supported_versions())\nprint(file.latest_version())\n```\n\n## Check AAS Type 2 (HTTP API)\n\n### Check a running server instance\n\n```python\nfrom aas_test_engines import api\n\ntests = api.generate_tests()\n\n# Check an instance\napi.execute_tests(tests, \"http://localhost\")\n\n# Check another instance\napi.execute_tests(tests, \"http://localhost:3000\")\n```\n\n### Checking older versions and specific test suites\n\nBy default, the `api.generate_tests` method generate test cases for version 3.0 of the standard and all associated test suites.\nYou may want to check against older versions by passing a string containing the version to these methods.\nYou can also provide a list of test suites to check against:\n\n```python\nfrom aas_test_engines import api\n\ntests = api.generate_tests('3.0', ['Asset Administration Shell API'])\napi.execute_tests(tests, \"http://localhost\")\n```\n\nFor the naming of test suites we follow the names given by the specification. These are:\n* **APIs:** Asset Administration Shell API, Submodel API, ...\n* **Service Specifications:** Asset Administration Shell Service Specification, Submodel Service Specification, ...\n* **Profiles:**  AssetAdministrationShellServiceSpecification/SSP-001, ...\n\nYou can query the list of supported versions and their associated test suites as follows:\n\n```python\nfrom aas_test_engines import api\n\nprint(api.supported_versions())\nprint(api.latest_version())\n```\n\n## Generating test data for software testing\n\nIf you develop an AAS application like an AAS editor you may want to use test data to verify correctness of your application.\nThe test engines allow to generate a set of AAS files which are compliant with the standard and you can therefore use to assess your application as follows:\n\n```python\nfrom aas_test_engines import file\n\nfor sample in file.generate():\n    print(sample) # or whatever you want to do with it\n```\n\n## Command line interface\n\nYou may want to invoke the test tools using the simplified command line interface:\n\n```sh\n# Check file\npython -m aas_test_engines check_file test.aasx\n\n# Check server\npython -m aas_test_engines check_server https://localhost --suite 'Asset Administration Shell API'\n\n# Generate test data\npython -m aas_test_engines generate_files output_dir\n```\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Official test tooling for the Asset Administration Shell",
    "version": "0.4.0",
    "project_urls": {
        "Homepage": "https://github.com/admin-shell-io/aas-test-engines"
    },
    "split_keywords": [
        "asset administration shell",
        " aas",
        " test"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8695ccb9822df7a903ccfef8383e6d21e085c713fb2cabb731018c6af427fd09",
                "md5": "8a39aecace69717ee81694a120c89ef3",
                "sha256": "8bdaee62bae492402c2e950b60bf00335079cfab12baeeeb06cc17dcd7615bad"
            },
            "downloads": -1,
            "filename": "aas_test_engines-0.4.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "8a39aecace69717ee81694a120c89ef3",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 70311,
            "upload_time": "2024-04-18T21:30:28",
            "upload_time_iso_8601": "2024-04-18T21:30:28.866108Z",
            "url": "https://files.pythonhosted.org/packages/86/95/ccb9822df7a903ccfef8383e6d21e085c713fb2cabb731018c6af427fd09/aas_test_engines-0.4.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "71e9c94feea91cad295bedd1c3e287f82e5110c1472b1425d5c6aafae642d41c",
                "md5": "8f5bad528ca4408e4181466d3109ad21",
                "sha256": "75f7a165f932324e12c3b5e9794dbbd2d47032bbcf1259cec5cb3769dc188618"
            },
            "downloads": -1,
            "filename": "aas_test_engines-0.4.0.tar.gz",
            "has_sig": false,
            "md5_digest": "8f5bad528ca4408e4181466d3109ad21",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 63284,
            "upload_time": "2024-04-18T21:30:30",
            "upload_time_iso_8601": "2024-04-18T21:30:30.793511Z",
            "url": "https://files.pythonhosted.org/packages/71/e9/c94feea91cad295bedd1c3e287f82e5110c1472b1425d5c6aafae642d41c/aas_test_engines-0.4.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-18 21:30:30",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "admin-shell-io",
    "github_project": "aas-test-engines",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "aas-test-engines"
}
        
Elapsed time: 0.23827s