From f344c8cd9dcdded537cee6aeb087cd64e448763f Mon Sep 17 00:00:00 2001 From: didericis Date: Mon, 11 May 2026 01:11:59 -0400 Subject: [PATCH] test(pipelock): cut low-value tests (naming + entrypoint/cmd inspection) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Drops 6 tests with no real coverage loss: - tests/test_pipelock_naming.py — 4 tests asserting that f-string format helpers return their f-string. Shape locks, not behavior gates. - tests/test_pipelock_image.py:test_entrypoint_contains_pipelock and :test_cmd_contains_run — Docker image metadata inspection. The remaining test_binary_runs already covers 'does the pinned image actually work,' which is the only scenario these were really guarding against. 31 tests -> 25. --- tests/test_pipelock_image.py | 27 +++------------------------ tests/test_pipelock_naming.py | 33 --------------------------------- 2 files changed, 3 insertions(+), 57 deletions(-) delete mode 100644 tests/test_pipelock_naming.py diff --git a/tests/test_pipelock_image.py b/tests/test_pipelock_image.py index 68f32a9..c8c1213 100644 --- a/tests/test_pipelock_image.py +++ b/tests/test_pipelock_image.py @@ -1,11 +1,7 @@ -"""Integration: verify the pinned pipelock image. Requires docker. - - Pinned digest is reachable on the registry. - - Image's ENTRYPOINT/CMD match what claude_bottle.pipelock assumes - (`/pipelock` and `run --listen 0.0.0.0:8888`). - - The /pipelock binary actually runs (--version succeeds).""" +"""Integration: the pinned pipelock image's binary actually runs. +Catches a broken upstream packaging at the pinned digest. Requires +docker.""" -import json -import re import subprocess import unittest @@ -17,7 +13,6 @@ from tests._docker import skip_unless_docker class TestPipelockImage(unittest.TestCase): @classmethod def setUpClass(cls): - # Pull the pinned image (cheap if cached). result = subprocess.run( ["docker", "pull", PIPELOCK_IMAGE], stdout=subprocess.DEVNULL, @@ -26,22 +21,6 @@ class TestPipelockImage(unittest.TestCase): if result.returncode != 0: raise unittest.SkipTest(f"could not pull {PIPELOCK_IMAGE}") - def test_entrypoint_contains_pipelock(self): - result = subprocess.run( - ["docker", "image", "inspect", PIPELOCK_IMAGE, - "--format", "{{json .Config.Entrypoint}}"], - capture_output=True, text=True, - ) - self.assertIn("/pipelock", result.stdout) - - def test_cmd_contains_run(self): - result = subprocess.run( - ["docker", "image", "inspect", PIPELOCK_IMAGE, - "--format", "{{json .Config.Cmd}}"], - capture_output=True, text=True, - ) - self.assertIn("run", result.stdout) - def test_binary_runs(self): result = subprocess.run( ["docker", "run", "--rm", PIPELOCK_IMAGE, "--version"], diff --git a/tests/test_pipelock_naming.py b/tests/test_pipelock_naming.py deleted file mode 100644 index a547a32..0000000 --- a/tests/test_pipelock_naming.py +++ /dev/null @@ -1,33 +0,0 @@ -"""Unit: pipelock naming helpers (container_name, proxy_url, proxy_host_port).""" - -import unittest - -from claude_bottle.pipelock import ( - pipelock_container_name, - pipelock_proxy_host_port, - pipelock_proxy_url, -) - - -class TestPipelockNaming(unittest.TestCase): - def test_container_name_simple(self): - self.assertEqual("claude-bottle-pipelock-foo", pipelock_container_name("foo")) - - def test_container_name_with_hyphens(self): - self.assertEqual( - "claude-bottle-pipelock-some-slug", pipelock_container_name("some-slug") - ) - - def test_proxy_url_default_port(self): - self.assertEqual( - "http://claude-bottle-pipelock-foo:8888", pipelock_proxy_url("foo") - ) - - def test_proxy_host_port_default_port(self): - self.assertEqual( - "claude-bottle-pipelock-foo:8888", pipelock_proxy_host_port("foo") - ) - - -if __name__ == "__main__": - unittest.main()