1b3254bf37
test / run tests/run_tests.py (pull_request) Successful in 14s
Both constants were already only used by Docker-specific code (the sidecar boot, the proxy_url/host_port naming helpers, the image contract test). Move them next to DockerPipelockProxy. Top-level pipelock.py drops the 'os' import along with the constants; the two test files that pulled PIPELOCK_IMAGE retarget at the new location.
35 lines
1021 B
Python
35 lines
1021 B
Python
"""Integration: the pinned pipelock image's binary actually runs.
|
|
Catches a broken upstream packaging at the pinned digest. Requires
|
|
docker."""
|
|
|
|
import subprocess
|
|
import unittest
|
|
|
|
from claude_bottle.backend.docker.pipelock import PIPELOCK_IMAGE
|
|
from tests._docker import skip_unless_docker
|
|
|
|
|
|
@skip_unless_docker()
|
|
class TestPipelockImage(unittest.TestCase):
|
|
@classmethod
|
|
def setUpClass(cls):
|
|
result = subprocess.run(
|
|
["docker", "pull", PIPELOCK_IMAGE],
|
|
stdout=subprocess.DEVNULL,
|
|
stderr=subprocess.DEVNULL,
|
|
)
|
|
if result.returncode != 0:
|
|
raise unittest.SkipTest(f"could not pull {PIPELOCK_IMAGE}")
|
|
|
|
def test_binary_runs(self):
|
|
result = subprocess.run(
|
|
["docker", "run", "--rm", PIPELOCK_IMAGE, "--version"],
|
|
capture_output=True, text=True,
|
|
)
|
|
out = result.stdout + result.stderr
|
|
self.assertRegex(out, r"[Pp]ipelock|2\.[0-9]+\.[0-9]+")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|