MCPcopy
hub / github.com/lektor/lektor / test_RsyncPublisher_integration

Function test_RsyncPublisher_integration

tests/test_publisher.py:46–67  ·  view source on GitHub ↗
(env, tmp_path, delete)

Source from the content-addressed store, hash-verified

44@pytest.mark.parametrize("delete", ["yes", "no"])
45@pytest.mark.filterwarnings(r"ignore:'werkzeug\.urls:DeprecationWarning")
46def test_RsyncPublisher_integration(env, tmp_path, delete):
47 # Integration test of local rsync deployment
48 # Ensures that RsyncPublisher can successfully invoke rsync
49 files = {"file.txt": "content\n"}
50 output = tmp_path / "output"
51 output.mkdir()
52 for path, content in files.items():
53 output.joinpath(path).write_text(content)
54
55 target_path = tmp_path / "target"
56 target_path.mkdir()
57 target = f"rsync://{target_path.resolve()}?delete={delete}"
58
59 event_iter = publish(env, target, output)
60 for line in event_iter:
61 print(line)
62
63 target_files = {
64 os.fspath(_.relative_to(target_path)): _.read_text()
65 for _ in target_path.iterdir()
66 }
67 assert target_files == files

Callers

nothing calls this directly

Calls 3

publishFunction · 0.90
mkdirMethod · 0.80
itemsMethod · 0.45

Tested by

no test coverage detected