Skip to content

Add test for rsync_tmbackup importer#80

Open
hiijoshi wants to merge 3 commits intoborgbackup:masterfrom
hiijoshi:add-rsync-tmbackup-test
Open

Add test for rsync_tmbackup importer#80
hiijoshi wants to merge 3 commits intoborgbackup:masterfrom
hiijoshi:add-rsync-tmbackup-test

Conversation

@hiijoshi
Copy link

@hiijoshi hiijoshi commented Mar 21, 2026

Summary

Added a test for the rsync_tmbackup importer.

Changes

  • Added a test that simulates rsync-time-backup style folders
  • Verifies archives can be imported into the target repository
  • Improves test coverage for the rsync_tmbackup importer

Reason

This extends importer test coverage using the same integration-style approach already used in the existing test suite.


assert len(archives) >= 1
assert any("backup1" in a or "backup2" in a for a in archives)
def test_rsync_tmbackup_import(tmpdir, monkeypatch):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

usually always have 2 empty lines between toplevel functions. but here, this also belongs into a different test module test_tmbackup.

).decode()
archives = output.splitlines()

assert len(archives) >= 1 No newline at end of file
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's a rather weak assertion. :-)

regex = re.compile(r"(?P<snapshot_date>.+)")

if not Path("backup.marker").exists():
if not (root / "backup.marker").exists():
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that looks like a bug fix?

Copy link
Member

@ThomasWaldmann ThomasWaldmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

@hiijoshi
Copy link
Author

Thanks for the review!

I’ve updated the PR by:

  • moving the rsync_tmbackup test into a separate test module (test_tmbackup.py)
  • improving assertions to check archive names and extracted file contents
  • aligning the test structure with existing integration-style tests

All tests are passing locally.

Please let me know if anything else should be improved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants