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