Show More
@@ -128,8 +128,7 b' class TestHooksHttpHandler(object):' | |||||
128 | with date_patcher, caplog.at_level(logging.DEBUG): |
|
128 | with date_patcher, caplog.at_level(logging.DEBUG): | |
129 | handler.log_message('Some message %d, %s', 123, 'string') |
|
129 | handler.log_message('Some message %d, %s', 123, 'string') | |
130 |
|
130 | |||
131 |
expected_message = |
|
131 | expected_message = "HOOKS: {} - - [{}] Some message 123, string".format(ip_port, fake_date) | |
132 | ip_port[0], fake_date) |
|
|||
133 | assert_message_in_log( |
|
132 | assert_message_in_log( | |
134 | caplog.records, expected_message, |
|
133 | caplog.records, expected_message, | |
135 | levelno=logging.DEBUG, module='hooks_daemon') |
|
134 | levelno=logging.DEBUG, module='hooks_daemon') | |
@@ -192,8 +191,8 b' class TestHttpHooksCallbackDaemon(object' | |||||
192 |
|
191 | |||
193 | _, port = tcp_server.server_address |
|
192 | _, port = tcp_server.server_address | |
194 | expected_uri = '{}:{}'.format('127.0.0.1', port) |
|
193 | expected_uri = '{}:{}'.format('127.0.0.1', port) | |
195 |
msg = ' |
|
194 | msg = 'HOOKS: {} Preparing HTTP callback daemon registering ' \ | |
196 |
' |
|
195 | 'hook object: rhodecode.lib.hooks_daemon.HooksHttpHandler'.format(expected_uri) | |
197 | assert_message_in_log( |
|
196 | assert_message_in_log( | |
198 | caplog.records, msg, levelno=logging.DEBUG, module='hooks_daemon') |
|
197 | caplog.records, msg, levelno=logging.DEBUG, module='hooks_daemon') | |
199 |
|
198 | |||
@@ -206,8 +205,8 b' class TestHttpHooksCallbackDaemon(object' | |||||
206 | expected_uri = '{}:{}'.format('127.0.0.1', port) |
|
205 | expected_uri = '{}:{}'.format('127.0.0.1', port) | |
207 | assert daemon.hooks_uri == expected_uri |
|
206 | assert daemon.hooks_uri == expected_uri | |
208 |
|
207 | |||
209 |
msg = ' |
|
208 | msg = 'HOOKS: {} Preparing HTTP callback daemon registering ' \ | |
210 |
' |
|
209 | 'hook object: rhodecode.lib.hooks_daemon.HooksHttpHandler'.format(expected_uri) | |
211 | assert_message_in_log( |
|
210 | assert_message_in_log( | |
212 | caplog.records, msg, |
|
211 | caplog.records, msg, | |
213 | levelno=logging.DEBUG, module='hooks_daemon') |
|
212 | levelno=logging.DEBUG, module='hooks_daemon') | |
@@ -329,10 +328,11 b' class MockRequest(object):' | |||||
329 |
|
328 | |||
330 |
|
329 | |||
331 | class MockServer(object): |
|
330 | class MockServer(object): | |
332 |
def __init__(self, |
|
331 | def __init__(self, handler_cls, request): | |
333 | ip_port = ('0.0.0.0', 8888) |
|
332 | ip_port = ('0.0.0.0', 8888) | |
334 | self.request = MockRequest(request) |
|
333 | self.request = MockRequest(request) | |
335 | self.handler = Handler(self.request, ip_port, self) |
|
334 | self.server_address = ip_port | |
|
335 | self.handler = handler_cls(self.request, ip_port, self) | |||
336 |
|
336 | |||
337 |
|
337 | |||
338 | @pytest.fixture() |
|
338 | @pytest.fixture() |
General Comments 0
You need to be logged in to leave comments.
Login now