|
12 | 12 | NODE_ID = "0fPFklV3" |
13 | 13 | FIND_NODE_ID = "0fPFklV3" |
14 | 14 | DELETED_NODE_IDS = "t8HkzBH2", "8EwHVJna" |
| 15 | +TEST_FS = Path(__file__).parent / "fake_fs.json" |
15 | 16 |
|
16 | 17 |
|
17 | 18 | @pytest.fixture(name="fs") |
@@ -118,17 +119,14 @@ def get_path(recursive: bool) -> list[str]: |
118 | 119 | assert get_path(recursive=True) == sorted(recursive_children) |
119 | 120 |
|
120 | 121 |
|
121 | | -def test_unsafe_filesystem() -> None: |
122 | | - path = Path(__file__).parent / "fake_fs.json" |
123 | | - dump = json.loads(path.read_text()) |
| 122 | +def test_unsafe_filesystem_build() -> None: |
| 123 | + dump = json.loads(TEST_FS.read_text()) |
124 | 124 | nodes = (Node.from_dump(node) for node in dump["nodes"].values()) |
125 | | - fs = UserFileSystem.build_unsafe(nodes) |
126 | | - assert fs.dump() == dump |
| 125 | + UserFileSystem.build_unsafe(nodes) |
127 | 126 |
|
128 | 127 |
|
129 | | -def test_safe_filesystem() -> None: |
130 | | - path = Path(__file__).parent / "fake_fs.json" |
131 | | - dump = json.loads(path.read_text()) |
| 128 | +def test_safe_filesystem_build() -> None: |
| 129 | + dump = json.loads(TEST_FS.read_text()) |
132 | 130 | nodes = (Node.from_dump(node) for node in dump["nodes"].values()) |
133 | 131 | fs = UserFileSystem.build(nodes) |
134 | | - path.write_text(json.dumps(fs.dump(), indent=2, ensure_ascii=False)) |
| 132 | + TEST_FS.write_text(json.dumps(fs.dump(), indent=2, ensure_ascii=False) + "\n") |
0 commit comments