From f305ee024a0280755dacbfdb616492e4bde2655c Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Thu, 12 Nov 2026 12:56:36 +0000 Subject: [PATCH] test(utils/inventory): read the rendered tools file through the file cache MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR #1663 run 43194423841 failed test-lint: tests/lint/filesystem/python/test_no_uncached_file_reads.py flagged test_tools_render.py:27, which read the rendered file with Path.read_text. It now reads it through utils.cache.files.read_text; the rendered path lives in a fresh tempdir per test, so the cache key is unique. Tests: test_tools_render and test_no_uncached_file_reads green. Negative control: the CI run on the old line. 🎯 Fix: 95 % 💥 Break: 1 % 💸 Cost: – ⏱️ Time: – 🛡️ Security: ~100 % 🏆 Score: 94 🚦 Gate: ✅ 90/5, cost and time <= 100, security 100 % Co-Authored-By: Claude Opus 5.5 --- tests/unit/python/utils/inventory/test_tools_render.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/unit/python/utils/inventory/test_tools_render.py b/tests/unit/python/utils/inventory/test_tools_render.py index 4d597864aa..0c3ac9dd19 100644 --- a/tests/unit/python/utils/inventory/test_tools_render.py +++ b/tests/unit/python/utils/inventory/test_tools_render.py @@ -5,6 +5,7 @@ import unittest from pathlib import Path from unittest.mock import patch +from utils.cache.files import read_text from utils.inventory import tools MARKUP = "/models/\"" @@ -24,7 +25,7 @@ class TestRender(unittest.TestCase): template.parent.mkdir(parents=True) template.write_text(TEMPLATE, encoding="utf-8") with patch.object(tools, "models_dir", return_value=MARKUP): - rendered = tools.render(root, ["en", "de"]).read_text(encoding="utf-8") + rendered = read_text(str(tools.render(root, ["en", "de"]))) self.assertIn(f'models: "{MARKUP}"', rendered) self.assertIn("languages: de,en", rendered) self.assertIn(f"key: {tools.API_KEY}", rendered)