MCPcopy Create free account
hub / github.com/chatmail/core / test_cache_writing

Method test_cache_writing

python/tests/test_4_lowlevel.py:19–32  ·  view source on GitHub ↗
(self, tmp_path)

Source from the content-addressed store, hash-verified

17
18class TestACSetup:
19 def test_cache_writing(self, tmp_path):
20 base = tmp_path.joinpath("hello")
21 base.mkdir()
22 d1 = base.joinpath("dir1")
23 d1.mkdir()
24 d1.joinpath("file1").write_bytes(b"content1")
25 d2 = d1.joinpath("dir2")
26 d2.mkdir()
27 d2.joinpath("file2").write_bytes(b"123")
28 d = create_dict_from_files_in_path(base)
29 newbase = tmp_path.joinpath("other")
30 write_dict_to_dir(d, newbase)
31 assert newbase.joinpath("dir1", "dir2", "file2").exists()
32 assert newbase.joinpath("dir1", "file1").exists()
33
34 def test_basic_states(self, acfactory, monkeypatch, testprocess):
35 pc = ACSetup(init_time=0.0, testprocess=testprocess)

Callers

nothing calls this directly

Calls 3

write_dict_to_dirFunction · 0.90
existsMethod · 0.45

Tested by

no test coverage detected