Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace config.set_request_property by config.add_request_method #31

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyramid_ldap/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ def get_connector(request):
registry = request.registry
return Connector(registry, manager)

config.set_request_property(get_connector, 'ldap_connector', reify=True)
config.add_request_method(get_connector, 'ldap_connector', property=True, reify=True)

intr = config.introspectable(
'pyramid_ldap setup',
Expand Down
4 changes: 3 additions & 1 deletion pyramid_ldap/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ def test_it_defaults(self):
self._callFUT(config, 'ldap://')
self.assertEqual(config.prop_name, 'ldap_connector')
self.assertEqual(config.prop_reify, True)
self.assertEqual(config.prop_property, True)
request = testing.DummyRequest()
self.assertEqual(config.prop(request).__class__, Connector)

Expand Down Expand Up @@ -304,7 +305,8 @@ def __init__(self):
def add_directive(self, name, fn):
self.directives.append(name)

def set_request_property(self, prop, name, reify=False):
def add_request_method(self, prop, name, property=False, reify=False):
self.prop_property = property
self.prop_reify = reify
self.prop_name = name
self.prop = prop
Expand Down