-
-
Notifications
You must be signed in to change notification settings - Fork 479
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
OAuth 2 Tests depend on dict ordering #62
Comments
Would it not be better to explicitly sort the keyword arguments?
|
Sorry, that patch isn't sufficient. I've uploaded a patch to Ubuntu and will do a pull request. |
@warsaw - Thanks for the patch & #63! OAuthLib aims to be very strictly spec compliant* and while sorting the parameters seem rather innocent it's not the expected behaviour. Furthermore I much rather improve the tests and make them robust than tweak the code to fit the tests. Adding an assert_url_equals method to TestCase is rather trivial (using urlparse for the heavy lifting). For the two tuples I think TestCase.assertItemsEqual should be sufficient.
|
@warsaw I was not sure if you found any time to work more on the PR or not and since I found a free spot in my calendar and sorted this out. I've added you to AUTHORS, let me know if you'd prefer not to be listed. Hopefully I covered most of it but will keep an eye out for flakyness. I've pushed this to PYPI as 0.3.2. Heard from @christofferholmstedt that you are working a bit with making OAuth requests and thought I'd give a shoutout to the awesome requests library that has OAuthLib powered OAuth support built in =) Here's an example on doing HMAC-SHA1 signed requests but RSA and plaintext are of course also supported. |
On Nov 08, 2012, at 12:05 PM, Ib Lundgren wrote:
Thanks so much! I was almost literally just getting back to this after UDS-R
Fantastic, thanks. I'll test the PyPI version. If it looks good, I'll go
Indeed! We've upgraded urllib3 and requests in 13.04 to the latest PyPI It all needs a bit of testing, but after I get everything uploaded properly,
Thanks! |
The reason requests vendors OAuthLib is because we are still in a flux with quite frequent changes. @kennethreitz is a very responsive and friendly guy so if the vendoring is a concern just ping him. Although we are unlikely to break anything related to OAuth 1 clients most of the OAuth 2 API will likely undergo quite a bit of changes. One day (probably quite a few months from now) I envision hitting 1.0 at which point the API will be stable. Feel free to send bugs, PRs and just about anything our way and we'll take a look at it =) |
URL strings may be generated differently depending on the internal dict order which is fine. Our tests however do naive string comparisons which is not adequate and breaks in python 3.3. There might already be a function such as assertURLEquals but I've not looked into this. If not it is worth monkey patching this onto TestCase and using it. It should be quite straightforward using urlsparse and just making sure all query and fragment pairs are present in both strings.
Test output
The text was updated successfully, but these errors were encountered: