Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

pep8 and pyflakes compliance

  • Loading branch information...
commit a6ee2acac39bb21a7802088a9901d4c785751800 1 parent 3db5016
Max Countryman maxcountryman authored
4 setup.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()
1  tests/test_hook.py
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)
-
3  tests/test_oauth.py
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)
-
10 tests/test_service.py
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,7 +244,7 @@ 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')
@@ -252,5 +252,5 @@ 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)
2  webauth/oauth.py
View
@@ -172,6 +172,7 @@ def sign(self, request, consumer, token=None):
class RsaSha1Signature(SignatureMethod):
'''RSA-SHA1 Signature Method. (Not implemented)'''
NAME = 'RSA-SHA1'
+
def __init__(self):
raise NotImplementedError
@@ -179,5 +180,6 @@ def __init__(self):
class PlaintextSignature(SignatureMethod):
'''PLAINTEXT Signature Method. (Not implemented)'''
NAME = 'PLAINTEXT'
+
def __init__(self):
raise NotImplementedError
Please sign in to comment.
Something went wrong with that request. Please try again.