diff options
| author | Michael Merickel <michael@merickel.org> | 2018-10-15 01:55:54 -0500 |
|---|---|---|
| committer | Michael Merickel <michael@merickel.org> | 2018-10-15 09:24:07 -0500 |
| commit | 0c29cf2df41600d3906d521c72991c7686018b71 (patch) | |
| tree | ff907f90ec9467e12874c9b2c961549d0e7caf74 /tests/pkgs/permbugapp | |
| parent | 851c368e3c158e264358de10446f5b5de240e534 (diff) | |
| download | pyramid-0c29cf2df41600d3906d521c72991c7686018b71.tar.gz pyramid-0c29cf2df41600d3906d521c72991c7686018b71.tar.bz2 pyramid-0c29cf2df41600d3906d521c72991c7686018b71.zip | |
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') |
