mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-29 22:37:29 +00:00
test(stack-host-files): read back what apply just wrote, uncached
The assertion checks the file apply() created one line above. Routed through the shared cache it would compare against the state before that write, so the read stays direct and says why. The marker sits on a hoisted variable rather than inside the assertEqual call: the formatter wraps the call across lines, and an inline nocheck only counts within the line span of the call it belongs to, so the one-liner form strands it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
8732bb7511
commit
8cc65b207f
1 file changed
+4
-1
@@ -116,7 +116,10 @@ class TestApply(unittest.TestCase):
|
||||
wanted = {"de.yaml": "Home: Startseite\n"}
|
||||
_MOD.apply(directory, {}, wanted, ["de.yaml"], [], "0640", "0750")
|
||||
target = directory / "de.yaml"
|
||||
self.assertEqual(target.read_text(encoding="utf-8"), wanted["de.yaml"])
|
||||
produced = target.read_text(
|
||||
encoding="utf-8"
|
||||
) # nocheck: cache-read apply() wrote this file a line above; a cached read would serve the pre-write state
|
||||
self.assertEqual(produced, wanted["de.yaml"])
|
||||
self.assertEqual(target.stat().st_mode & 0o777, 0o640)
|
||||
self.assertEqual(directory.stat().st_mode & 0o777, 0o750)
|
||||
|
||||
|
||||
Reference in new issue
Block a user