Permalink
Browse files

pep8 and pyflakes compliance

  • Loading branch information...
1 parent 3db5016 commit a6ee2acac39bb21a7802088a9901d4c785751800 @maxcountryman maxcountryman committed Mar 13, 2012
Showing with 10 additions and 10 deletions.
  1. +2 −2 setup.py
  2. +0 −1 tests/test_hook.py
  3. +1 −2 tests/test_oauth.py
  4. +5 −5 tests/test_service.py
  5. +2 −0 webauth/oauth.py
View
@@ -5,8 +5,8 @@
from setuptools import setup, find_packages
if sys.argv[-1] == 'test':
- os.system('pyflakes webauth; '
- 'pep8 webauth && '
+ os.system('pyflakes webauth tests; '
+ 'pep8 webauth tests && '
'nosetests --with-coverage --cover-package=webauth')
sys.exit()
View
@@ -109,4 +109,3 @@ def test_custom_signature_object(self):
some_signature = Mock()
oauth = OAuth1Hook('123', '345', signature=some_signature)
self.assertTrue(oauth.signature is some_signature)
-
View
@@ -97,7 +97,7 @@ def test_normalize_request_parameters_params_string(self):
self.assertEqual('a=b&foo=bar', normalized)
def test_normalize_request_parameters_data_string(self):
- # params is a dict but data is a string
+ # params is a dict but data is a string
self.request.params = {'a': 'b'}
self.request.data = urlencode({'foo': 'bar'})
normalized = \
@@ -126,4 +126,3 @@ def test_rsasha1_notimplemented(self):
class OAuthTestPlaintextCase(WebauthTestCase):
def test_plaintext_notimplemented(self):
self.assertRaises(NotImplementedError, PlaintextSignature)
-
View
@@ -168,7 +168,7 @@ def test_get_request_token_post(self, mock_request):
@patch.object(requests.Session, 'request')
def test_get_request_token_header_auth(self, mock_request):
mock_request.return_value = self.response
-
+
self.service.header_auth = True
request_token, request_token_secret = \
self.service.get_request_token('POST')
@@ -218,13 +218,13 @@ def test_get_access_token_bad_response(self, mock_request):
mock_request.return_value = self.response
try:
- self.service.get_access_token('123','456', 'GET')
+ self.service.get_access_token('123', '456', 'GET')
except Exception, e:
self.assertEqual('Response not OK!', str(e))
self.assertRaises(Exception,
self.service.get_access_token,
- ('123','456', 'GET'))
+ ('123', '456', 'GET'))
@patch.object(requests.Session, 'request')
def test_request_get(self, mock_request):
@@ -244,13 +244,13 @@ def test_json_response(self, mock_request):
mock_request.return_value = self.response
self.response.content = json.dumps({'a': 'b'})
- access_resp = self.service.get_access_token('123','456', 'GET')
+ access_resp = self.service.get_access_token('123', '456', 'GET')
self.assertEqual({'a': 'b'}, access_resp)
@patch.object(requests.Session, 'request')
def test_other_response(self, mock_request):
mock_request.return_value = self.response
self.response.content = {'a': 'b'}
- access_resp = self.service.get_access_token('123','456', 'GET')
+ access_resp = self.service.get_access_token('123', '456', 'GET')
self.assertEqual({'a': 'b'}, access_resp)
View
@@ -172,12 +172,14 @@ def sign(self, request, consumer, token=None):
class RsaSha1Signature(SignatureMethod):
'''RSA-SHA1 Signature Method. (Not implemented)'''
NAME = 'RSA-SHA1'
+
def __init__(self):
raise NotImplementedError
class PlaintextSignature(SignatureMethod):
'''PLAINTEXT Signature Method. (Not implemented)'''
NAME = 'PLAINTEXT'
+
def __init__(self):
raise NotImplementedError

0 comments on commit a6ee2ac

Please sign in to comment.