test: cover QueueStore/AuditStore guard branches and supervise bundle spec
Add 8 tests covering the branches that were keeping diff-coverage below 90%: explicit db_path constructor arg, early-return guards when the DB file is absent, _chmod OSError swallowing in both store classes, and the supervise volume/env/daemon path in _bundle_launch_spec. Diff-coverage rises from 89.2% to 94.6% (176/186 changed lines).
This commit is contained in:
@@ -422,6 +422,14 @@ class TestBundleLaunchSpec(unittest.TestCase):
|
||||
spec.environment,
|
||||
)
|
||||
|
||||
def test_supervise_adds_daemon_volume_and_env(self):
|
||||
from bot_bottle.supervise import DB_PATH_IN_CONTAINER
|
||||
plan = _plan(supervise=True)
|
||||
spec = _bundle_launch_spec(plan, "net", "127.0.0.16")
|
||||
self.assertIn("supervise", spec.daemons_csv)
|
||||
self.assertIn(f"SUPERVISE_DB_PATH={DB_PATH_IN_CONTAINER}", spec.environment)
|
||||
self.assertIn(("/tmp/bot-bottle.db", DB_PATH_IN_CONTAINER, False), spec.volumes)
|
||||
|
||||
def test_canary_env_visible_to_smolvm_guest(self):
|
||||
plan = _plan(canary=True)
|
||||
with patch.object(
|
||||
|
||||
Reference in New Issue
Block a user