From b51463a5c457a3f748bfbb8f4a6fe022e260aab5 Mon Sep 17 00:00:00 2001 From: Brian Krabach Date: Fri, 3 Apr 2026 22:18:30 -0700 Subject: [PATCH] =?UTF-8?q?test:=20code=20quality=20fixes=20=E2=80=94=20do?= =?UTF-8?q?cstring=20count,=20ruff=20format,=20test=20name=20accuracy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Update test_tls.py module docstring: '9 tests' → '12 tests' (stale after edge case additions) - Parenthesize assertion message on line 177 of test_tls.py (ruff line-length format) - Rename test_serve_warns_when_only_cert_set → test_serve_no_ssl_when_only_cert_set to accurately reflect test behavior (verifies no SSL, not that a warning is printed) --- muxplex/tests/test_cli.py | 2 +- muxplex/tests/test_tls.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/muxplex/tests/test_cli.py b/muxplex/tests/test_cli.py index 9b6c198..75d87f2 100644 --- a/muxplex/tests/test_cli.py +++ b/muxplex/tests/test_cli.py @@ -1641,7 +1641,7 @@ def test_doctor_shows_tls_clipboard_warning(tmp_path, monkeypatch, capsys): # --------------------------------------------------------------------------- -def test_serve_warns_when_only_cert_set(tmp_path, monkeypatch, capsys): +def test_serve_no_ssl_when_only_cert_set(tmp_path, monkeypatch, capsys): """serve() must NOT enable SSL when tls_cert is set but tls_key is empty string.""" import muxplex.cli as cli_mod diff --git a/muxplex/tests/test_tls.py b/muxplex/tests/test_tls.py index a3f3d3b..92b87c7 100644 --- a/muxplex/tests/test_tls.py +++ b/muxplex/tests/test_tls.py @@ -1,6 +1,6 @@ """ Tests for muxplex/tls.py — TLS certificate generation and inspection. -9 tests covering generate_self_signed() and get_cert_info(). +12 tests covering generate_self_signed() and get_cert_info(). """ import stat @@ -174,7 +174,9 @@ def test_generate_self_signed_with_custom_hostnames(tmp_path): result = generate_self_signed(cert_path, key_path, hostnames=custom_hostnames) assert isinstance(result, dict), "generate_self_signed() must return a dict" - assert isinstance(result.get("hostnames"), list), "result['hostnames'] must be a list" + assert isinstance(result.get("hostnames"), list), ( + "result['hostnames'] must be a list" + ) assert "mybox.local" in result["hostnames"], ( f"'mybox.local' must be in result['hostnames'], got: {result['hostnames']!r}" )