test: fix test_cache_miss and remove unused re import
lint / lint (push) Successful in 2m8s
test / unit (pull_request) Successful in 1m1s
test / integration (pull_request) Successful in 16s
test / coverage (pull_request) Failing after 1m6s

- test_smolmachines_launch_image: save mock now touches the tarball path
  so tarball.chmod(0o644) doesn't fail with FileNotFoundError
- test_smolmachines_launch (integration): remove unused `re` import
  (pyright reportUnusedImport)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-07-09 00:03:00 -04:00
parent 3703b6f59f
commit 70e58f1333
2 changed files with 5 additions and 2 deletions
+5 -1
View File
@@ -94,6 +94,10 @@ class TestEnsureSmolmachine(unittest.TestCase):
calls.append(name)
return _f
def save_and_record(image_ref: str, path: str) -> None:
Path(path).touch()
calls.append("save")
with patch.object(
_launch_mod.docker_mod, "build_image",
side_effect=record("build"),
@@ -102,7 +106,7 @@ class TestEnsureSmolmachine(unittest.TestCase):
return_value=f"sha256:{digest}fffffffffffffffff",
), patch.object(
_launch_mod.docker_mod, "save",
side_effect=record("save"),
side_effect=save_and_record,
) as save, patch.object(
_launch_mod, "ephemeral_registry",
return_value=_Reg(),