Show More
@@ -605,9 +605,13 b' def add_events_routes(config):' | |||||
605 | pattern='/{repo_name}/files/{commit_id}/{f_path}') |
|
605 | pattern='/{repo_name}/files/{commit_id}/{f_path}') | |
606 |
|
606 | |||
607 |
|
607 | |||
608 | def bootstrap_request(): |
|
608 | def bootstrap_request(**kwargs): | |
609 | import pyramid.testing |
|
609 | import pyramid.testing | |
610 | request = pyramid.testing.DummyRequest() |
|
610 | request = pyramid.testing.DummyRequest(**kwargs) | |
|
611 | request.application_url = kwargs.pop('application_url', 'http://example.com') | |||
|
612 | request.host = kwargs.pop('host', 'example.com:80') | |||
|
613 | request.domain = kwargs.pop('domain', 'example.com') | |||
|
614 | ||||
611 | config = pyramid.testing.setUp(request=request) |
|
615 | config = pyramid.testing.setUp(request=request) | |
612 | add_events_routes(config) |
|
616 | add_events_routes(config) | |
613 |
|
617 |
@@ -207,7 +207,9 b' class Hooks(object):' | |||||
207 |
|
207 | |||
208 | def _call_hook(self, hook, extras): |
|
208 | def _call_hook(self, hook, extras): | |
209 | extras = AttributeDict(extras) |
|
209 | extras = AttributeDict(extras) | |
210 | extras.request = bootstrap_request() |
|
210 | ||
|
211 | extras.request = bootstrap_request( | |||
|
212 | application_url=extras['server_url']) | |||
211 |
|
213 | |||
212 | try: |
|
214 | try: | |
213 | result = hook(extras) |
|
215 | result = hook(extras) |
General Comments 0
You need to be logged in to leave comments.
Login now