| 44 | @pytest.mark.parametrize("delete", ["yes", "no"]) |
| 45 | @pytest.mark.filterwarnings(r"ignore:'werkzeug\.urls:DeprecationWarning") |
| 46 | def 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 |