Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

aas-testing-client3.2

Continuous integration PyPI - version PyPI - Python Version Documentation

Test servers of the Asset Administration Shell, Part 2: API (IDTA-01002) version 3.2 against the specification.

The testing client mirrors the modules of aas-client3.2 with the same function names and signatures, so switching between them is a matter of the import. Every function is decorated with icontract pre- and postconditions:

  • the preconditions check your input, such as that the payload passes the verification of aas-core3.2, so that a failure is due to the server, not to your test, and

  • the postconditions check the responses of the server, such as the exact status codes, the content types, the headers, the verification of the payloads, and that the server gives what you asked for: the right identifiable, the limit of a page, or only the direct children for level=core.

  • the errors are checked as well: a server error is always a violation, every rejection carries a Result, and 501 is allowed only for the operations beyond the profiles which the server declares.

A violated contract raises icontract.ViolationError with a message which tells what went wrong.

Two subpackages mirror the same modules with stronger checks:

  • aas_testing_client3_2.sequential reads the affected resource before and after every change, and checks the effect: the server stores what it accepted, nothing else changes, and a rejected request has no effect. It also follows the asynchronous requests across the calls, and aas_testing_client3_2.sequential.interrupted drops the connection in the middle of an upload, and checks that the server keeps the old or the complete new resource. Use it from a single thread against a server which only your tests use.

  • aas_testing_client3_2.concurrent records the writes and the reads of all your threads in a shared history, and checks that the server never gives a value which nobody wrote, and that it behaves like a regular (or atomic) register.

Appetizer

Write the conformance tests of your server with unittest or pytest on top of the testing client. For example, check that a Submodel Repository stores a submodel and gives it back:

import unittest

import requests

import aas_core3_2.types as aas_types

from aas_client3_2 import http
from aas_client3_2 import requests_transport
from aas_testing_client3_2 import submodel_repository


class TestSubmodelRepository(unittest.TestCase):
    def setUp(self) -> None:
        self.server = http.Server(
            transport=requests_transport.RequestsTransport(requests.Session()),
            base_url="http://localhost:5005",
        )

    def test_post_and_get(self) -> None:
        submodel = aas_types.Submodel(
            id="https://example.com/ids/sm/conformance",
            id_short="Conformance",
        )

        # The contracts check the responses of the server.
        submodel_repository.post_submodel(self.server, submodel)
        self.addCleanup(
            submodel_repository.delete_submodel_by_id, self.server, submodel.id
        )

        got = submodel_repository.get_submodel_by_id(self.server, submodel.id)
        self.assertEqual("Conformance", got.id_short)


if __name__ == "__main__":
    unittest.main()

Installation

Install the testing client together with the transport based on requests of the client:

pip3 install aas-testing-client3.2 aas-client3.2[requests]

The testing client is released in lockstep with the client, and depends on its exact version.

Documentation

The testing client shares the documentation with the client: https://eclipse-aascw.github.io/aas-client3.2-python/

Contributing

The testing client is developed together with the client in eclipse-aascw/aas-client3.2-python. If you want to contribute, see our contributing guide.

Metadata

Release files for aas-testing-client3.2 1.0.0rc1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aas-testing-client3.2 1.0.0rc1
File Size Uploaded Provenance Actions
aas_testing_client3_2-1.0.0rc1.tar.gz 94.3 kB Without provenance Details for aas_testing_client3_2-1.0.0rc1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for aas-testing-client3.2 1.0.0rc1
File Interpreter ABI Platform Actions
aas_testing_client3_2-1.0.0rc1-py3-none-any.whl Python 3 none any Details for aas_testing_client3_2-1.0.0rc1-py3-none-any.whl

Total release size: 221.9 kB

Release files / aas_testing_client3_2-1.0.0rc1.tar.gz

Download URL aas_testing_client3_2-1.0.0rc1.tar.gz
Size 94.3 kB
Tags Source
SHA-256 checksum
How to use checksums
d142c89841cd76bc264b2c2bbe5c28bb30c42664a2cc25e09df1bc30d63c7d94
BLAKE2b-256 checksum
How to use checksums
8c12a9e243d264ab0e1e142e01587457e97fb2b67cf1c12c56b7b67c449d7feb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.12

Release files / aas_testing_client3_2-1.0.0rc1-py3-none-any.whl

Download URL aas_testing_client3_2-1.0.0rc1-py3-none-any.whl
Size 127.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1b3272a054c746f0b8d4f9fa647f74da795419fec8ea5c6e093667b0790b536e
BLAKE2b-256 checksum
How to use checksums
f3ddce173c25254f4bb4415d097a1dd918d53e809529ed66830adc30c11c4acd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.12

Security for aas-testing-client3.2 1.0.0rc1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page