Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Python Exception at API Tests #17

Closed
sebbader-sap opened this issue May 2, 2024 · 2 comments
Closed

Bug: Python Exception at API Tests #17

sebbader-sap opened this issue May 2, 2024 · 2 comments

Comments

@sebbader-sap
Copy link

sebbader-sap commented May 2, 2024

Minimal example:

File at sba_tests/test_my_own_server.py (following

```python
):

from aas_test_engines import api

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

Stack Trace:

python3 sba_tests/test_my_own_server.py:

Traceback (most recent call last):
  File "/Users/sba/Documents/2_git/aas-test-engines/sba_tests/test_my_own_server.py", line 3, in <module>
    tests = api.generate_tests('3.0', ['Asset Administration Shell API'])
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/aas_test_engines/api.py", line 58, in generate_tests
    conf = generate.generate(spec.api, suites)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/aas_test_engines/_api/generate.py", line 343, in generate
    if op.tags & tag_filter:
       ~~~~~~~~^~~~~~~~~~~~
TypeError: unsupported operand type(s) for &: 'set' and 'list'
@sebbader-sap sebbader-sap changed the title Bug: p Bug: Python Exception at API Tests May 2, 2024
@sebbader-sap
Copy link
Author

Is this caused by my Python version?

@otto-ifak
Copy link
Collaborator

This is actually not a bug but wrong in the README. I have corrected this:

from aas_test_engines import api

tests = api.generate_tests(suites=set(['Asset Administration Shell API']))

conf = api.run.ExecConf(
    server = "http://localhost",
)

for result in api.execute_tests(tests, conf):
    result.dump()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants