From c333e4c76d42dc5c813a52b22fbe5328304a8ae8 Mon Sep 17 00:00:00 2001 From: Jason McCormick Date: Mon, 2 Nov 2026 20:42:45 -0500 Subject: updates for prod --- tests/test_he_dyndns.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'tests') diff --git a/tests/test_he_dyndns.py b/tests/test_he_dyndns.py index d839a26..0fbe343 100644 --- a/tests/test_he_dyndns.py +++ b/tests/test_he_dyndns.py @@ -34,6 +34,24 @@ class EchoTests(unittest.TestCase): with self.assertRaisesRegex(ValueError, "loopback"): ip_echo.proxied_address("192.0.2.10", "198.51.100.20") + def test_error_response_contains_only_status_code(self): + handler = object.__new__(ip_echo.AddressHandler) + handler.command = "GET" + handler.wfile = mock.Mock() + handler.send_response = mock.Mock() + handler.send_header = mock.Mock() + handler.end_headers = mock.Mock() + + handler.send_error(404, "ignored") + + handler.send_response.assert_called_once_with(404) + handler.send_header.assert_has_calls([ + mock.call("Content-Type", "text/plain; charset=us-ascii"), + mock.call("Content-Length", "4"), + ]) + handler.end_headers.assert_called_once_with() + handler.wfile.write.assert_called_once_with(b"404\n") + class DiscoveryTests(unittest.TestCase): @mock.patch.object(he_dyndns, "http_get") -- cgit v1.2.3