diff --git a/autopush/tests/test_log_check.py b/autopush/tests/test_log_check.py index 1fdad108..4c07b6d1 100644 --- a/autopush/tests/test_log_check.py +++ b/autopush/tests/test_log_check.py @@ -58,3 +58,8 @@ def test_get_crit(self): assert payload.get('error') == "Test Failure" self.flushLoggedErrors() + + @inlineCallbacks + def test_invalid(self): + resp = yield self.client.get('/v1/err/bogus') + assert resp.get_status() == 404 diff --git a/autopush/tests/test_rs_integration.py b/autopush/tests/test_rs_integration.py index 56520c22..68965ad8 100644 --- a/autopush/tests/test_rs_integration.py +++ b/autopush/tests/test_rs_integration.py @@ -786,6 +786,7 @@ def setUp(self): mock_server_thread = Thread(target=mock_server.serve_forever) mock_server_thread.setDaemon(True) mock_server_thread.start() + self.addCleanup(mock_server.shutdown) self.mock_server_thread = mock_server_thread self.mock_megaphone = MockMegaphoneRequestHandler diff --git a/autopush/web/log_check.py b/autopush/web/log_check.py index 46e13dec..eb16e2c0 100644 --- a/autopush/web/log_check.py +++ b/autopush/web/log_check.py @@ -38,7 +38,7 @@ def get(self, err_type=None): client_info=self._client_info) self._write_response(418, 999, message="ERROR:Success", error="Test Error") - if 'crit' in err_type: + elif 'crit' in err_type: try: raise LogCheckError("LogCheck") except LogCheckError: @@ -47,3 +47,5 @@ def get(self, err_type=None): client_info=self._client_info) self._write_response(418, 999, message="FAILURE:Success", error="Test Failure") + else: + self._write_response(404, 0) diff --git a/autopush_rs/__init__.py b/autopush_rs/__init__.py index 319a1e2c..4cf3826f 100644 --- a/autopush_rs/__init__.py +++ b/autopush_rs/__init__.py @@ -32,7 +32,7 @@ def __init__(self, conf, queue): cfg.ssl_cert = ffi_from_buffer(conf.ssl.cert) cfg.ssl_dh_param = ffi_from_buffer(conf.ssl.dh_param) cfg.ssl_key = ffi_from_buffer(conf.ssl.key) - cfg.json_logging = conf.human_logs + cfg.json_logging = not conf.human_logs cfg.statsd_host = ffi_from_buffer(conf.statsd_host) cfg.statsd_port = conf.statsd_port cfg.megaphone_api_url = ffi_from_buffer(conf.megaphone_api_url)