diff --git a/bot_bottle/config_store.py b/bot_bottle/config_store.py index 400f1da..bc2f607 100644 --- a/bot_bottle/config_store.py +++ b/bot_bottle/config_store.py @@ -7,11 +7,11 @@ from pathlib import Path try: from .db_store import DbStore from .migrations import TableMigrations - from .supervise_types import host_db_path + from .paths import host_db_path except ImportError: from db_store import DbStore # type: ignore[import-not-found] # pylint: disable=import-error,no-name-in-module from migrations import TableMigrations # type: ignore[import-not-found] # pylint: disable=import-error,no-name-in-module - from supervise_types import host_db_path # type: ignore[import-not-found] # pylint: disable=import-error,no-name-in-module + from paths import host_db_path # type: ignore[import-not-found] # pylint: disable=import-error,no-name-in-module DEFAULT_CACHED_IMAGE_STALE_WARNING_DAYS = 1 diff --git a/tests/unit/test_stale_checks.py b/tests/unit/test_stale_checks.py index 06860d6..d1efcf1 100644 --- a/tests/unit/test_stale_checks.py +++ b/tests/unit/test_stale_checks.py @@ -7,7 +7,6 @@ calls are mocked at the module boundary.""" from __future__ import annotations import unittest -from pathlib import Path from types import SimpleNamespace from typing import Any, cast from unittest.mock import MagicMock, patch @@ -94,17 +93,18 @@ class TestDockerStaleChecks(unittest.TestCase): cs.assert_called_once() self.assertIn("committed:latest", cs.call_args.args[0]) - def test_no_committed_image_checks_agent_and_sidecar(self) -> None: + def test_no_committed_image_checks_agent(self) -> None: from bot_bottle.backend.docker import launch as mod from datetime import datetime, timezone ts = datetime(2025, 1, 1, tzinfo=timezone.utc) + plan = self._plan() with patch.object(mod, "read_committed_image", return_value=""), \ patch.object(mod.docker_mod, "image_exists", return_value=True), \ patch.object(mod.docker_mod, "image_created_at", return_value=ts), \ patch.object(mod, "check_stale") as cs: - mod.stale_checks(self._plan()) - # Should have been called for both agent and sidecar images. - self.assertEqual(2, cs.call_count) + mod.stale_checks(plan) + cs.assert_called_once() + self.assertIn(plan.image, cs.call_args.args[0]) def test_image_not_present_skips_check(self) -> None: from bot_bottle.backend.docker import launch as mod @@ -173,16 +173,18 @@ class TestMacosContainerStaleChecks(unittest.TestCase): cs.assert_called_once() self.assertIn("committed:latest", cs.call_args.args[0]) - def test_no_committed_image_checks_agent_and_sidecar(self) -> None: + def test_no_committed_image_checks_agent(self) -> None: from bot_bottle.backend.macos_container import launch as mod from datetime import datetime, timezone ts = datetime(2025, 1, 1, tzinfo=timezone.utc) + plan = self._plan() with patch.object(mod, "read_committed_image", return_value=""), \ patch.object(mod.container_mod, "image_exists", return_value=True), \ patch.object(mod.container_mod, "image_created_at", return_value=ts), \ patch.object(mod, "check_stale") as cs: - mod.stale_checks(self._plan()) - self.assertEqual(2, cs.call_count) + mod.stale_checks(plan) + cs.assert_called_once() + self.assertIn(plan.image, cs.call_args.args[0]) def test_image_not_present_skips_check(self) -> None: from bot_bottle.backend.macos_container import launch as mod