Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cubicweb
cubes
trustedauth
Commits
f958c90026de
Commit
5d3acb7d
authored
Feb 05, 2019
by
Nsukami Patrick
Browse files
Flake8: fix W293, E303, W391
parent
c4834b672a20
Changes
2
Hide whitespace changes
Inline
Side-by-side
cubicweb_trustedauth/pconfig.py
View file @
f958c900
...
...
@@ -68,4 +68,3 @@ class TrustedAuthenticationPolicy(object):
forgetting the user. This will be application-specific and can
be done somewhere else or in a subclass."""
return
()
test/test_pyramid.py
View file @
f958c900
...
...
@@ -18,7 +18,7 @@ class TestController(Controller):
class
PyramidTrustedAuthRequestTC
(
PyramidCWTest
):
test_db_id
=
'trustedauth'
def
includeme
(
self
,
config
):
includeme
(
config
)
...
...
@@ -29,7 +29,6 @@ class PyramidTrustedAuthRequestTC(PyramidCWTest):
self
.
assertEqual
(
200
,
req
.
status_int
)
self
.
assertEqual
(
'VALID'
,
result
)
def
_test_header_format
(
self
,
hkey
,
login
,
http_method
=
'GET'
,
headers
=
None
,
content
=
None
,
url
=
'/testauth'
,
**
params
):
if
headers
is
None
:
...
...
@@ -52,20 +51,20 @@ class PyramidTrustedAuthRequestTC(PyramidCWTest):
login
=
'admin'
,
)
self
.
_assert_auth
(
req
,
result
)
def
test_bad_login
(
self
):
result
,
req
=
self
.
_test_header_format
(
hkey
=
'X-Remote-User'
,
login
=
'admin2'
,
)
self
.
_assert_auth_failed
(
req
,
result
)
def
test_bad_key
(
self
):
result
,
req
=
self
.
_test_header_format
(
hkey
=
'X-Remote-User2'
,
login
=
'admin'
,
)
self
.
_assert_auth_failed
(
req
,
result
)
if
__name__
==
"__main__"
:
from
logilab.common.testlib
import
unittest_main
unittest_main
()
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment