Merge lp:~dobey/ubuntu-sso-client/oauth-api-break into lp:ubuntu-sso-client

Proposed by dobey
Status: Merged
Approved by: dobey
Approved revision: 1029
Merged at revision: 1028
Proposed branch: lp:~dobey/ubuntu-sso-client/oauth-api-break
Merge into: lp:ubuntu-sso-client
Diff against target: 39 lines (+6/-12)
2 files modified
ubuntu_sso/utils/webclient/common.py (+6/-3)
ubuntu_sso/utils/webclient/tests/test_webclient.py (+0/-9)
To merge this branch: bzr merge lp:~dobey/ubuntu-sso-client/oauth-api-break
Reviewer Review Type Date Requested Status
Mike McCracken (community) Approve
Brian Curtin (community) Approve
Review via email: mp+156675@code.launchpad.net

Commit message

Handle the API changing in 0.3.8 by avoiding passing in params for GET/HEAD.

To post a comment you must log in.
Revision history for this message
Brian Curtin (brian.curtin) wrote :

Tests pass on Windows.

review: Approve
Revision history for this message
Mike McCracken (mikemc) wrote :

With oauthlib 0.3.8 on darwin, this branch has the following test failures:

[ERROR]
Traceback (most recent call last):
  File "/Users/mmccrack/Documents/Canonical/Source/test-improve-buildout/scripts/devsetup/parts/ubuntu-sso-client/ubuntu_sso/utils/webclient/tests/test_webclient.py", line 805, in test_build_oauth_request_with_params
    self.test_build_oauth_request(params=self.sample_params)
  File "/Users/mmccrack/Documents/Canonical/Source/test-improve-buildout/scripts/devsetup/parts/ubuntu-sso-client/ubuntu_sso/utils/webclient/tests/test_webclient.py", line 799, in test_build_oauth_request
    self.assertIn(param, body)
exceptions.TypeError: argument of type 'NoneType' is not iterable

ubuntu_sso.utils.webclient.tests.test_webclient.OAuthHmacSha1TestCase.test_build_oauth_request_with_params
ubuntu_sso.utils.webclient.tests.test_webclient.OAuthPlainTextTestCase.test_build_oauth_request_with_params

review: Needs Fixing
Revision history for this message
Mike McCracken (mikemc) wrote :

note - those same tests do pass with oauthlib 0.3.7 on darwin

1029. By dobey

Remove the offending test code, which seems inappropriate now.

Revision history for this message
Mike McCracken (mikemc) wrote :

tests pass now

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ubuntu_sso/utils/webclient/common.py'
2--- ubuntu_sso/utils/webclient/common.py 2013-02-19 22:12:47 +0000
3+++ ubuntu_sso/utils/webclient/common.py 2013-04-12 20:11:22 +0000
4@@ -157,9 +157,12 @@
5 else SIGNATURE_TYPE_AUTH_HEADER),
6 timestamp=str(timestamp))
7
8- url, signed_headers, body = oauth_client.sign(
9- uri, method, parameters if parameters is not None else {},
10- {'Content-Type': 'application/x-www-form-urlencoded'})
11+ try:
12+ url, signed_headers, body = oauth_client.sign(
13+ uri, method, parameters if parameters is not None else {},
14+ {'Content-Type': 'application/x-www-form-urlencoded'})
15+ except ValueError:
16+ url, signed_headers, body = oauth_client.sign(uri, method)
17
18 return url, signed_headers, body
19
20
21=== modified file 'ubuntu_sso/utils/webclient/tests/test_webclient.py'
22--- ubuntu_sso/utils/webclient/tests/test_webclient.py 2013-02-19 22:12:47 +0000
23+++ ubuntu_sso/utils/webclient/tests/test_webclient.py 2013-04-12 20:11:22 +0000
24@@ -794,15 +794,6 @@
25
26 self.assert_headers_correct(signed_headers)
27 self.assertEqual(url, self.sample_url)
28- if params is not None:
29- for param, value in params.items():
30- self.assertIn(param, body)
31- actual = body[param]
32- self.assertEqual(value, actual)
33-
34- def test_build_oauth_request_with_params(self):
35- """Check that the oauth request are properly with params."""
36- self.test_build_oauth_request(params=self.sample_params)
37
38 @defer.inlineCallbacks
39 def test_build_signed_iri(self, params=None):

Subscribers

People subscribed via source and target branches