diff options
Diffstat (limited to 'packages/meshbay-hub/tests/test_video_seek.py')
| -rw-r--r-- | packages/meshbay-hub/tests/test_video_seek.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/packages/meshbay-hub/tests/test_video_seek.py b/packages/meshbay-hub/tests/test_video_seek.py index 9436065..3289eda 100644 --- a/packages/meshbay-hub/tests/test_video_seek.py +++ b/packages/meshbay-hub/tests/test_video_seek.py @@ -46,7 +46,7 @@ pytestmark = pytest.mark.skipif(not APP.exists(), reason="SPA sources unavailabl @pytest.fixture(scope="module") def app(): - return APP.read_text() + return APP.read_text(encoding="utf-8") def _player(app: str) -> str: @@ -164,7 +164,7 @@ def test_the_leak_deadlocks_the_window_and_the_fix_clears_it(): proc = subprocess.run( ["node", str(harness), str(APP), json.dumps({"decrementFirst": decrement_first})], - capture_output=True, text=True) + capture_output=True, text=True, encoding="utf-8") assert proc.returncode == 0, proc.stderr return json.loads(proc.stdout) @@ -269,7 +269,7 @@ def test_seeks_are_debounced(app): """Dragging fires `seeking` continuously; each one we act on costs a spawn.""" player = _player(app) assert "SEEK_DEBOUNCE_MS" in player, "every intermediate drag position seeks" - ms = int(re.search(r"const SEEK_DEBOUNCE_MS = (\d+)", APP.read_text()).group(1)) + ms = int(re.search(r"const SEEK_DEBOUNCE_MS = (\d+)", APP.read_text(encoding="utf-8")).group(1)) assert 150 <= ms <= 1000, ( f"{ms} ms is either short enough to still storm the node or long " "enough to feel broken") @@ -289,7 +289,7 @@ def test_a_seek_inside_the_buffer_does_not_reach_the_node(app): def test_the_position_is_kept_in_this_browser(app): """localStorage: no protocol, no storage for anyone else to keep, and nothing new learns what you watch.""" - src = APP.read_text() + src = APP.read_text(encoding="utf-8") assert "mb:pos:" in src, "no position is stored" read = src[src.index("function readResumePosition"):] read = read[:read.index("\n}")] @@ -299,7 +299,7 @@ def test_the_position_is_kept_in_this_browser(app): def test_a_finished_film_does_not_offer_to_resume(app): - src = APP.read_text() + src = APP.read_text(encoding="utf-8") write = src[src.index("function writeResumePosition"):] write = write[:write.index("\n}")] assert "RESUME_MAX_FRACTION" in write and "removeItem" in write, ( @@ -317,6 +317,6 @@ def test_the_viewer_can_refuse_the_resume(app): @pytest.mark.parametrize("locale", ["en", "fr", "es", "pt-BR", "zh-CN", "ja", "de", "it", "nl", "pl"]) def test_the_resume_strings_exist_everywhere(locale): - text = (STATIC / "locales" / f"{locale}.js").read_text() + text = (STATIC / "locales" / f"{locale}.js").read_text(encoding="utf-8") for key in ("video.resumed_at", "video.from_start"): assert key in text, f"{locale} is missing {key}" |