From 2de223a33b8a2bbfd6364c91231f66ac36b0679c Mon Sep 17 00:00:00 2001 From: didericis Date: Mon, 20 Jul 2026 13:40:14 -0400 Subject: [PATCH] test(gateway-image): probe package imports, not pre-refactor flat modules MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit test_python_imports_supervise_module probed the image with `import supervise; import supervise_server`, the flat sibling modules that 5ad3449 replaced. They now live in the installed package, so the test fails with ModuleNotFoundError when actually run. It went unnoticed because the whole class carries a GITEA_ACTIONS skip — it is interactive-only, so CI never executes it. All 4 tests in the class now pass against a freshly built gateway image. Closes #429. Co-Authored-By: Claude Opus 4.8 --- tests/integration/test_gateway_image.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tests/integration/test_gateway_image.py b/tests/integration/test_gateway_image.py index 2f31989..87e5d97 100644 --- a/tests/integration/test_gateway_image.py +++ b/tests/integration/test_gateway_image.py @@ -86,13 +86,12 @@ class TestGatewayImage(unittest.TestCase): self.assertIn("Mitmproxy", out) def test_python_imports_supervise_module(self): - # The bundle's supervise daemon imports `supervise` as a - # same-directory sibling of `supervise_server`. Probe the - # import resolves with `python3 -c` from /app (the - # Dockerfile's WORKDIR). + # The supervise daemon is installed as part of the bot_bottle + # package (5ad3449), not as flat sibling modules under /app. + # Probe that the package imports resolve inside the image. rc, out = self._run_in_image( "python3", "-c", - "import supervise; import supervise_server; print('ok')", + "from bot_bottle import supervise, supervise_server; print('ok')", ) self.assertEqual(0, rc, msg=out) self.assertIn("ok", out)