From 6343c150ef7436220e540ee7dc591ce3f77f2fd4 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 1 Oct 2026 14:30:57 +0000 Subject: [PATCH] Fix unit CI failures in app tests Co-authored-by: MCKero6423 <222912022+MCKero6423@users.noreply.github.com> --- tools/test_uvk5_apps.py | 7 +++++++ tools/webui.py | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/tools/test_uvk5_apps.py b/tools/test_uvk5_apps.py index e0072c7..bd39e91 100644 --- a/tools/test_uvk5_apps.py +++ b/tools/test_uvk5_apps.py @@ -140,6 +140,13 @@ class TestInstall(unittest.TestCase): class TestResolve(unittest.TestCase): def test_a_bare_name_is_found_under_work_apps(self): """The first attempt at this used 'Beam.app' from the repository root.""" + work_apps = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "work", "apps") + os.makedirs(work_apps, exist_ok=True) + beam = os.path.join(work_apps, "Beam.app") + if not os.path.exists(beam): + with open(beam, "wb") as fh: + fh.write(b"fixture") + self.addCleanup(lambda: os.path.exists(beam) and os.unlink(beam)) path = A.resolve("Beam.app") self.assertTrue(os.path.exists(path), path) diff --git a/tools/webui.py b/tools/webui.py index 5448225..729ff5d 100644 --- a/tools/webui.py +++ b/tools/webui.py @@ -480,7 +480,9 @@ def create_app(client, frame_addr: int = None, status_addr: int = None, scale: i # Power off, apply edit(path) to a working copy, power on again. if flash is None: raise RuntimeError("this server was started without flash control") - work = os.path.join(upload_dir(), "flash-current.img") + directory = upload_dir() + os.makedirs(directory, exist_ok=True) + work = os.path.join(directory, "flash-current.img") running = supervisor is not None and supervisor.is_running() if running: # Takes the emulator's own write-back with it, so an edit builds on what