-
Notifications
You must be signed in to change notification settings - Fork 28
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
Ability to play back responses by parameters instead of order #38
Comments
This could be relevant: https://github.com/boto/botocore/blob/develop/botocore/stub.py Also, for an early version of this that I did just for the skew library, I encoded the parameters into the file name so that could be an option. |
I know it would increase the complexity a bit, but I was thinking that maybe it would be better if this used a single file instead of multiple ones, or else uses the existing file structure but uses a special file to key the parameters to the filename? Encoding the parameters into the filename would probably work in most common cases, but I can also see the filenames getting very long for some API calls (which would look especially bad on GitHub). It's also problematic with how long the iteration tokens are for some API responses (EC2 As an example of a problematic filename, I'm thinking of something like:
|
What about serializing the parameters and then using a hash function to create a low collision unique ID. ecs.DescribeContainerInstances_XXXXXXXXX.json where XXXXXXXX is the hash. |
Just working on this now, so far hashing on parameters (uri, body, etc) is working ok in my limited testing. Thinking about what edge cases might come up here now. Pagination would be one at least, not sure how I should handle that atm. |
If the matching is done on a query param lookup rather than merely an index then the assertions would be MUCH better and also such a change would avoid the need for #83 |
Difficult to understand / explain / maintain. Matching via a lookup text file that lists expected queries is more straightforward. |
As was discussed in #36 (comment) it would be really nice if placebo could automatically capture the parameters/arguments for API calls, and then play the calls back according to the parameters instead of order (perhaps using order only if there are multiple calls with the same parameters).
The text was updated successfully, but these errors were encountered: