summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSviatoslav Sydorenko <wk@sydorenko.org.ua>2018-04-22 05:08:47 +0200
committerSviatoslav Sydorenko <wk@sydorenko.org.ua>2018-04-22 05:08:47 +0200
commitc62d90e9ae85df46ceb21ee4b1520296fa42ad4c (patch)
treeda3f31f6c7a90cab429a03dfd74098266ef0a362
parentcd10f044a292fa1bd2e00a38410aa9e0f2eeed01 (diff)
downloadcherrypy-git-c62d90e9ae85df46ceb21ee4b1520296fa42ad4c.tar.gz
Fix linter complaints @ test_auth_digest
-rw-r--r--cherrypy/test/test_auth_digest.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/cherrypy/test/test_auth_digest.py b/cherrypy/test/test_auth_digest.py
index 6f94790c..0387e33e 100644
--- a/cherrypy/test/test_auth_digest.py
+++ b/cherrypy/test/test_auth_digest.py
@@ -57,13 +57,13 @@ class DigestAuthTest(helper.CPWebCase):
self.getPage('/digest/')
assert self.status_code == 401
-
+ msg = 'Digest authentification scheme was not found'
www_auth_digest = tuple(filter(
lambda kv: kv[0].lower() == 'www-authenticate'
and kv[1].startswith('Digest '),
self.headers,
))
- assert len(www_auth_digest) == 1, 'Digest authentification scheme was not found'
+ assert len(www_auth_digest) == 1, msg
items = www_auth_digest[0][-1][7:].split(', ')
tokens = {}
@@ -98,7 +98,10 @@ class DigestAuthTest(helper.CPWebCase):
# calculate the response digest
ha1 = get_ha1(auth.realm, auth.username)
response = auth.request_digest(ha1)
- auth_header = base_auth % (encoded_user, realm, nonce, response, '00000001')
+ auth_header = base_auth % (
+ encoded_user, realm,
+ nonce, response, '00000001',
+ )
self.getPage('/digest/', [('Authorization', auth_header)])
def test_wrong_realm(self):
@@ -114,4 +117,6 @@ class DigestAuthTest(helper.CPWebCase):
def test_unicode_user(self):
self._test_parametric_digest(username='йюзер', realm='localhost')
assert self.status == '200 OK'
- assert self.body == ntob("Hello йюзер, you've been authorized.", 'utf-8')
+ assert self.body == ntob(
+ "Hello йюзер, you've been authorized.", 'utf-8',
+ )