##// END OF EJS Templates
events: make sure we propagate our dummy request with proper application_url....
marcink -
r1960:c9da1578 default
parent child Browse files
Show More
@@ -605,9 +605,13 b' def add_events_routes(config):'
605 605 pattern='/{repo_name}/files/{commit_id}/{f_path}')
606 606
607 607
608 def bootstrap_request():
608 def bootstrap_request(**kwargs):
609 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 615 config = pyramid.testing.setUp(request=request)
612 616 add_events_routes(config)
613 617
@@ -207,7 +207,9 b' class Hooks(object):'
207 207
208 208 def _call_hook(self, hook, extras):
209 209 extras = AttributeDict(extras)
210 extras.request = bootstrap_request()
210
211 extras.request = bootstrap_request(
212 application_url=extras['server_url'])
211 213
212 214 try:
213 215 result = hook(extras)
General Comments 0
You need to be logged in to leave comments. Login now