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

RequestSequence is difficult to use on Python 3 #191

Open
twm opened this issue Jun 20, 2017 · 0 comments
Open

RequestSequence is difficult to use on Python 3 #191

twm opened this issue Jun 20, 2017 · 0 comments

Comments

@twm
Copy link
Contributor

twm commented Jun 20, 2017

RequestSequence is very picky about types of arguments, but lacks any checking or coercion. For example, in the request tuple:

  • b'get' vs. 'get'—the former is required
  • b'get' vs. 'GET'—the former is required
  • The URL is str, but everything else must be bytes

If you pass the wrong type, the request sequence will not ever match. I'd say we should blacklist str where bytes is required and vice-versa. (Blacklist rather than whitelist because the ability to pass fuzzy matchers like HasHeaders is useful.)

In the response tuple:

And generally speaking, writing out these tuples is easy to botch. Perhaps we should add a builder API to make it easier?

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

1 participant