remove log output checks

the intention of this test is testing whether borg check
returns an error when checking a corrupted repository.

the removed assertions were rather testing the test logging
configuration, which seems flaky:

- when running all tests, assertions failed
- when running only this one test, assertions succeeded
- assertions also succeeded when running all the tests before
  they were refactored to separate test modules, although the
  test code was not changed, just moved.
This commit is contained in:
Thomas Waldmann 2022-09-13 16:22:16 +02:00
parent 1cd105d9f5
commit f410de690d

View file

@ -12,20 +12,18 @@ from . import ArchiverTestCaseBase, RK_ENCRYPTION
class ArchiverTestCase(ArchiverTestCaseBase):
def test_corrupted_repository(self):
def test_check_corrupted_repository(self):
self.cmd(f"--repo={self.repository_location}", "rcreate", RK_ENCRYPTION)
self.create_src_archive("test")
self.cmd(f"--repo={self.repository_location}", "extract", "test", "--dry-run")
output = self.cmd(f"--repo={self.repository_location}", "check", "--show-version")
self.assert_in("borgbackup version", output) # implied output even without --info given
self.assert_not_in("Starting repository check", output) # --info not given for root logger
self.cmd(f"--repo={self.repository_location}", "check")
name = sorted(os.listdir(os.path.join(self.tmpdir, "repository", "data", "0")), reverse=True)[1]
with open(os.path.join(self.tmpdir, "repository", "data", "0", name), "r+b") as fd:
fd.seek(100)
fd.write(b"XXXX")
output = self.cmd(f"--repo={self.repository_location}", "check", "--info", exit_code=1)
self.assert_in("Starting repository check", output) # --info given for root logger
self.cmd(f"--repo={self.repository_location}", "check", exit_code=1)
class ArchiverCorruptionTestCase(ArchiverTestCaseBase):