From 12e938d23cb68c717d0bce7dd71fe78b23967e3b Mon Sep 17 00:00:00 2001 From: Libby Date: Wed, 11 Nov 2026 17:25:03 +0000 Subject: [PATCH] Python @directory walk asserts the directory stays empty; manifest comment names the write paths Co-Authored-By: Claude Sonnet 5.5 --- packages/cultcache-py/tests/test_cultcache.py | 6 ++---- .../vectors/document-variants-c2a/readability/manifest.txt | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/cultcache-py/tests/test_cultcache.py b/packages/cultcache-py/tests/test_cultcache.py index 71365acf..a8c1dbe7 100644 --- a/packages/cultcache-py/tests/test_cultcache.py +++ b/packages/cultcache-py/tests/test_cultcache.py @@ -1606,14 +1606,12 @@ class CultCacheTests(unittest.TestCase): # A path that cannot be reached as a file stays an OSError (_read_store): not a store that failed to decode. with self.assertRaises(OSError, msg=f"{vector} {operation}"): run() + self.assertTrue(store_path.is_dir() and not any(store_path.iterdir()), f"{vector} {operation} touched the directory") else: with self.assertRaises(StoreUnreadableError, msg=f"{vector} {operation}") as refused: run() self.assertIsNotNone(refused.exception.__cause__, f"{vector} {operation}") - if content is None: - self.assertTrue(store_path.is_dir() and not any(store_path.iterdir()), f"{vector} {operation} touched the directory") - else: - self.assertEqual(store_path.read_bytes(), content, f"{vector} {operation} rewrote a file it cannot read") + self.assertEqual(store_path.read_bytes(), content, f"{vector} {operation} rewrote a file it cannot read") @staticmethod def _rec(type: str, key: str, second: int = 0) -> CultCacheEnvelope: diff --git a/tests/vectors/document-variants-c2a/readability/manifest.txt b/tests/vectors/document-variants-c2a/readability/manifest.txt index ba9f7f66..eda1783a 100644 --- a/tests/vectors/document-variants-c2a/readability/manifest.txt +++ b/tests/vectors/document-variants-c2a/readability/manifest.txt @@ -1,7 +1,7 @@ # Whether each runtime's own reader opens the file. A flush and a commit replace a file exactly when it reads; where a runtime has a soft flush (TypeScript, Rust) it leaves a file that reads byte for byte and refuses one that does not. # A store holding two records under one key is unreadable; keys are ordinal strings (no case folding, no normalisation), so distinct spellings are distinct keys. # Columns: file, csharp, rust, typescript, python. `../v3-base.msgpack` is the one valid store. -# `@directory` is no file: the walker makes an empty directory at the store path and every runtime must refuse to open it. +# `@directory` is no file: the walker makes an empty directory at the store path and every runtime must refuse to open it and to write over it (flush, commit, delete), leaving the directory empty. ../v3-base.msgpack reads reads reads reads zero-byte.bin refuses refuses refuses refuses empty-array.bin reads reads reads reads