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

Test harness should support variable responses per API endpoint #93

Open
displague opened this issue Jul 7, 2020 · 0 comments
Open

Comments

@displague
Copy link
Member

The current test harness loads a fixture matching the API method and URL components. This approach is limited as there can be only one fixture per URL+method. https://github.com/packethost/packet-python/blob/master/test/test_packet.py#L226-L251

In order to test all each branch properly, expected and unexpected, sunny and rainy, responses must be provided as fixtures.

One way to get this behavior would be to hash all request parameters and append this into the fixture filename. This would make fixture creation hard because the names would not be predictable. This also wouldn't fulfill the problem because our fixtures should be able to provide various API responses given the same inputs.

A more versatile solution would be one that allows for numerous fixture responses to be defined per test or for more granularity, per API call.

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

No branches or pull requests

1 participant