Skip to content
Browse files

updating to address potential key duplicate issue

  • Loading branch information...
1 parent e14d4de commit 26bdbf4ad58d2f106363a38ba0bb830948a26fc2 @maxcountryman maxcountryman committed Jun 12, 2012
Showing with 7 additions and 6 deletions.
  1. +1 −1 rauth/__init__.py
  2. +1 −0 rauth/service.py
  3. +5 −5 tests/test_service.py
View
2 rauth/__init__.py
@@ -6,4 +6,4 @@
'''
-__version__ = '0.4.10'
+__version__ = '0.4.11'
View
1 rauth/service.py
@@ -23,6 +23,7 @@ def parse_utf8_qsl(s):
if isinstance(k, unicode) and isinstance(v, unicode):
# skip this iteration if we have no keys or values to update
continue
+ d.pop(k)
if not isinstance(k, unicode):
k = unicode(k, 'utf-8')
if not isinstance(v, unicode):
View
10 tests/test_service.py
@@ -283,11 +283,11 @@ def test_get_request_token_bad_response(self, mock_request):
self.response.ok = False
self.response.content = 'Oops, something went wrong :('
self.response.raise_for_status = self.raise_for_status
-
mock_request.return_value = self.response
- response = self.service.get_request_token('GET')
- self.assertEqual(response, 'Oops, something went wrong :(')
+ with self.assertRaises(Exception) as e:
+ self.service.get_request_token('GET')
+ self.assertEqual(str(e.exception), 'Response not OK!')
def test_get_authorize_url(self):
authorize_url = self.service.get_authorize_url(request_token='123')
@@ -487,12 +487,12 @@ def test_parse_utf8_qsl_dup_keys(self, mock_request):
mock_request.return_value = self.response
# test that we don't end up with deplicate keys
- self.response.content = u'\xe2\x82\xac=euro'
+ self.response.content = '=euro'
response = self.service.request('GET',
'/',
access_token='a',
access_token_secret='b')
- expected = {u'\xe2\x82\xac': u'euro'}
+ expected = {u'\u20ac': u'euro'}
self.assertEqual(response.content, expected)

0 comments on commit 26bdbf4

Please sign in to comment.
Something went wrong with that request. Please try again.