Add basic test for rsynchl importer#79
Conversation
ThomasWaldmann
left a comment
There was a problem hiding this comment.
thanks for the PR, some stuff i found.
|
|
||
| # Create archives in the source repository | ||
| subprocess.check_call(["borg", "create", f"{source_repo}::archive1", "."], cwd=str(archive1_data)) | ||
|
|
There was a problem hiding this comment.
try to avoid changing unrelated files.
There was a problem hiding this comment.
test_borg is for the "from borg" importer.
| assert extract_dir2.join("file2.txt").read() == "This is file 2 in archive 2" | ||
|
|
||
|
|
||
| def test_rsynchl_import(tmpdir, monkeypatch): |
There was a problem hiding this comment.
this should be rather in a test_rsync(hl?) module.
| archive1.join("file.txt").write("hello1") | ||
| archive2.join("file.txt").write("hello2") |
There was a problem hiding this comment.
maybe have 2 files in each archive.
| assert len(archives) >= 1 | ||
| assert any("backup1" in a or "backup2" in a for a in archives) No newline at end of file |
There was a problem hiding this comment.
rather do the tests in the same way as in test_borg. that is simpler and more correct (you needed "all" here, not "any").
There was a problem hiding this comment.
also, do not only check the archives, but also the files in the archives - see test_borg.
There was a problem hiding this comment.
always end files with a linefeed so that diff does not complain.
|
Thanks for the review! I understand the issue now. I’ll update this PR by:
I’ll push an updated version shortly. |
|
Thanks for the detailed feedback! I’ve addressed the issues:
All tests are now passing. Please let me know if anything else should be improved. |
Summary
Added a basic test for the rsynchl importer.
Changes
Reason
This helps validate rsynchl import functionality and improves confidence in importer behavior.
This test follows the existing integration-style approach used in test_borg and extends coverage to another importer.