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

Rethink how interface tests are specified #68

Open
PietroPasotti opened this issue Apr 24, 2023 · 1 comment
Open

Rethink how interface tests are specified #68

PietroPasotti opened this issue Apr 24, 2023 · 1 comment

Comments

@PietroPasotti
Copy link
Contributor

          I know this is out of scope of this PR but the framework makes it non-trivial to check what is exactly validated. We're not asserting anything explicitly.

When I'm reviewing this test for example, I have a hard time figuring out, what exactly are we validating. The same goes for the next one where the devil's in the "schema=SchemaConfig.empty" detail.

Originally posted by @gruyaume in #57 (comment)

@PietroPasotti
Copy link
Contributor Author

One possible API I have in mind at the moment is:

from interface_tester import register_test_case, Role, SchemaConfig

# minimal test case
register_test_case(
name='foo',
role=Role.requirer)

# schema
register_test_case(
name='bar',
role=Role.requirer,
schema=SchemaConfig.empty)
 
# validator, instead of the decorated function
register_test_case(
name='baz',
role=Role.provider,
validator=lambda output_state: output_state.status.unit.name == 'active')

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