diff options
| author | Michael Merickel <github@m.merickel.org> | 2018-10-15 09:56:42 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-10-15 09:56:42 -0500 |
| commit | bda1306749c62ef4f11cfe567ed7d56c8ad94240 (patch) | |
| tree | 304c696c105ca15bbe0f13d96c79524974de768b /tests/pkgs/permbugapp | |
| parent | 81576ee51564c49d5ff3c1c07f214f22a8438231 (diff) | |
| parent | a54bc1ccac17625991e26eb5d4577f893803c683 (diff) | |
| download | pyramid-bda1306749c62ef4f11cfe567ed7d56c8ad94240.tar.gz pyramid-bda1306749c62ef4f11cfe567ed7d56c8ad94240.tar.bz2 pyramid-bda1306749c62ef4f11cfe567ed7d56c8ad94240.zip | |
Merge pull request #3388 from mmerickel/black
format source using black
Diffstat (limited to 'tests/pkgs/permbugapp')
| -rw-r--r-- | tests/pkgs/permbugapp/__init__.py | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/tests/pkgs/permbugapp/__init__.py b/tests/pkgs/permbugapp/__init__.py index 4868427a5..aedd405f8 100644 --- a/tests/pkgs/permbugapp/__init__.py +++ b/tests/pkgs/permbugapp/__init__.py @@ -2,21 +2,26 @@ from pyramid.compat import escape from pyramid.security import view_execution_permitted from pyramid.response import Response -def x_view(request): # pragma: no cover - return Response('this is private!') + +def x_view(request): # pragma: no cover + return Response('this is private!') + def test(context, request): # should return false - msg = 'Allow ./x? %s' % repr(view_execution_permitted( - context, request, 'x')) - return Response(escape(msg)) + msg = 'Allow ./x? %s' % repr( + view_execution_permitted(context, request, 'x') + ) + return Response(escape(msg)) + def includeme(config): - from pyramid.authentication import AuthTktAuthenticationPolicy - from pyramid.authorization import ACLAuthorizationPolicy - authn_policy = AuthTktAuthenticationPolicy('seekt1t', hashalg='sha512') - authz_policy = ACLAuthorizationPolicy() - config.set_authentication_policy(authn_policy) - config.set_authorization_policy(authz_policy) - config.add_view(test, name='test') - config.add_view(x_view, name='x', permission='private') + from pyramid.authentication import AuthTktAuthenticationPolicy + from pyramid.authorization import ACLAuthorizationPolicy + + authn_policy = AuthTktAuthenticationPolicy('seekt1t', hashalg='sha512') + authz_policy = ACLAuthorizationPolicy() + config.set_authentication_policy(authn_policy) + config.set_authorization_policy(authz_policy) + config.add_view(test, name='test') + config.add_view(x_view, name='x', permission='private') |
