diff options
Diffstat (limited to 'packages/meshbay-node/tests/test_root_ops_reach_the_live_set.py')
| -rw-r--r-- | packages/meshbay-node/tests/test_root_ops_reach_the_live_set.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/packages/meshbay-node/tests/test_root_ops_reach_the_live_set.py b/packages/meshbay-node/tests/test_root_ops_reach_the_live_set.py index e90fdfe..b2b3650 100644 --- a/packages/meshbay-node/tests/test_root_ops_reach_the_live_set.py +++ b/packages/meshbay-node/tests/test_root_ops_reach_the_live_set.py @@ -58,7 +58,7 @@ async def _state(tmp_path: Path) -> tuple[dict, Roster]: f' [[groups.roots]]\n path = "{(tmp_path / "one").as_posix()}"\n' f' name = "one"\n\n' f' [[groups.roots]]\n path = "{(tmp_path / "two").as_posix()}"\n' - f' name = "two"\n') + f' name = "two"\n', encoding="utf-8") live = RootSet.build([asdict(r) for r in cfg.roots]) index = GroupIndex(group_id=GROUP, sk_node=Ed25519PrivateKey.generate()) @@ -101,7 +101,7 @@ async def test_adding_a_root_reaches_node_toml_and_the_ack(tmp_path): assert [r["name"] for r in result["roots"]] == ["one", "two", "uploads"] assert [r.name for r in state["config"].groups[0].roots] == [ "one", "two", "uploads"] - assert "uploads" in Path(state["config_path"]).read_text() + assert "uploads" in Path(state["config_path"]).read_text(encoding="utf-8") finally: await roster.close() @@ -111,7 +111,7 @@ async def test_removing_a_root_reaches_node_toml_and_the_ack(tmp_path): try: result = await ops.remove_root(state, GROUP, "two") assert [r["name"] for r in result["roots"]] == ["one"] - assert Path(state["config_path"]).read_text().count( + assert Path(state["config_path"]).read_text(encoding="utf-8").count( "[[groups.roots]]") == 1 finally: await roster.close() @@ -229,7 +229,7 @@ async def test_adding_the_same_directory_twice_is_still_refused(tmp_path): await ops.add_root(state, GROUP, str(tmp_path / "uploads")) assert len(state["config"].groups[0].roots) == 3, ( "the refused add left something behind") - assert Path(state["config_path"]).read_text().count( + assert Path(state["config_path"]).read_text(encoding="utf-8").count( "[[groups.roots]]") == 3 finally: await roster.close() @@ -283,12 +283,12 @@ async def test_the_file_on_disk_and_the_config_in_memory_agree(tmp_path): await ops.remove_root(state, GROUP, "one") import tomllib - on_disk = tomllib.loads(Path(state["config_path"]).read_text()) + on_disk = tomllib.loads(Path(state["config_path"]).read_text(encoding="utf-8")) disk_paths = [str(r["path"]) for r in on_disk["groups"][0]["roots"]] memory_paths = [Path(r.path).as_posix() for r in state["config"].groups[0].roots] assert disk_paths == memory_paths - assert Path(state["config_path"]).read_text().count( + assert Path(state["config_path"]).read_text(encoding="utf-8").count( "[[groups.roots]]") == 2 finally: await roster.close() |