diff options
Diffstat (limited to 'packages/meshbay-hub/tests/test_memory_ceiling.py')
| -rw-r--r-- | packages/meshbay-hub/tests/test_memory_ceiling.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/packages/meshbay-hub/tests/test_memory_ceiling.py b/packages/meshbay-hub/tests/test_memory_ceiling.py index 5984292..9ea6ad3 100644 --- a/packages/meshbay-hub/tests/test_memory_ceiling.py +++ b/packages/meshbay-hub/tests/test_memory_ceiling.py @@ -51,7 +51,7 @@ def _lift(name, source): @pytest.fixture(scope="module") def target_fn(): """The ceiling, its error and the real function — read, never re-typed.""" - src = FILE_UTILS.read_text() + src = FILE_UTILS.read_text(encoding="utf-8") ceiling = re.search(r"^const MEMORY_CEILING = .*?;$", src, re.M) assert ceiling, "MEMORY_CEILING is gone from file-utils.js" # The test's own CEILING constant must agree with the source's, or every @@ -123,8 +123,8 @@ try {{ outcome = {{ kind: 'refused', name: err.name, message: err.message }}; }} console.log(JSON.stringify(outcome)); -""") - proc = subprocess.run(["node", str(script)], capture_output=True, text=True) +""", encoding="utf-8") + proc = subprocess.run(["node", str(script)], capture_output=True, text=True, encoding="utf-8") assert proc.returncode == 0, proc.stderr return json.loads(proc.stdout) @@ -259,7 +259,7 @@ def test_no_unguarded_memory_floor(target_fn): def test_the_guard_is_what_the_preview_uses_too(target_fn): """`FilePreview` decrypts a whole entry with no writable at all, so it needs the same ceiling — and must import it rather than keep a second number.""" - files_app = (STATIC / "files-app.js").read_text() + files_app = (STATIC / "files-app.js").read_text(encoding="utf-8") assert "MEMORY_CEILING" in files_app assert re.search(r"entry\.size\s*>\s*MEMORY_CEILING", files_app), ( "the preview modal must refuse an oversized entry before fetching it") |