diff options
Diffstat (limited to 'packages/meshbay-hub/tests/test_search_media_merge.py')
| -rw-r--r-- | packages/meshbay-hub/tests/test_search_media_merge.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/packages/meshbay-hub/tests/test_search_media_merge.py b/packages/meshbay-hub/tests/test_search_media_merge.py index 3464902..082de7e 100644 --- a/packages/meshbay-hub/tests/test_search_media_merge.py +++ b/packages/meshbay-hub/tests/test_search_media_merge.py @@ -50,7 +50,7 @@ EXPORT = re.compile(r"^export \{[^}]*\};?\s*$", re.M) def _block(path, header): """One top-level `function name(...) {` ... `}` read out of a module.""" - src = path.read_text() + src = path.read_text(encoding="utf-8") m = re.search(r"^" + re.escape(header) + r".*?^\}", src, re.M | re.S) assert m, ( f"{header} is no longer where this test reads it from in {path.name} — " @@ -60,7 +60,7 @@ def _block(path, header): def _const(name): m = re.search(r"^const " + re.escape(name) + r" = .*?;$", - SEARCH_PAGE.read_text(), re.M) + SEARCH_PAGE.read_text(encoding="utf-8"), re.M) assert m, f"{name} moved — the search-page units cannot be lifted" return m.group(0) @@ -70,7 +70,7 @@ def pipeline(): """Everything the three views need, in one script.""" return "\n".join([ "const t = (k) => k;", - EXPORT.sub("", MERGE.read_text()), + EXPORT.sub("", MERGE.read_text(encoding="utf-8")), _block(VIDEO_APP, "function underVideoRoot(entry, directories) {"), _block(VIDEO_APP, "function buildSeasons(episodes) {"), _block(VIDEO_APP, "function groupVideoEntries(entries, videoDirectories) {"), @@ -90,9 +90,9 @@ def pipeline(): def _node(tmp_path, pipeline, body): script = tmp_path / "case.js" - script.write_text(f"{pipeline}\n{body}\n") + script.write_text(f"{pipeline}\n{body}\n", encoding="utf-8") out = subprocess.run( - ["node", str(script)], capture_output=True, text=True, timeout=30) + ["node", str(script)], capture_output=True, text=True, encoding="utf-8", timeout=30) assert out.returncode == 0, out.stderr return json.loads(out.stdout) |