mirror of
https://github.com/borgbackup/borg.git
synced 2026-03-21 01:50:04 -04:00
testsuite/repository: fixup for 7a569bc
This commit is contained in:
parent
1f33861fd6
commit
9ebb37cab8
1 changed files with 7 additions and 7 deletions
|
|
@ -283,38 +283,38 @@ class RepositoryAuxiliaryCorruptionTestCase(RepositoryTestCaseBase):
|
|||
self.repository.commit()
|
||||
|
||||
def test_corrupted_hints(self):
|
||||
with open(os.path.join(self.repository.path, 'hints.0'), 'ab') as fd:
|
||||
with open(os.path.join(self.repository.path, 'hints.1'), 'ab') as fd:
|
||||
fd.write(b'123456789')
|
||||
self.do_commit()
|
||||
|
||||
def test_deleted_hints(self):
|
||||
os.unlink(os.path.join(self.repository.path, 'hints.0'))
|
||||
os.unlink(os.path.join(self.repository.path, 'hints.1'))
|
||||
self.do_commit()
|
||||
|
||||
def test_deleted_index(self):
|
||||
os.unlink(os.path.join(self.repository.path, 'index.0'))
|
||||
os.unlink(os.path.join(self.repository.path, 'index.1'))
|
||||
self.do_commit()
|
||||
|
||||
def test_unreadable_hints(self):
|
||||
hints = os.path.join(self.repository.path, 'hints.0')
|
||||
hints = os.path.join(self.repository.path, 'hints.1')
|
||||
os.unlink(hints)
|
||||
os.mkdir(hints)
|
||||
with self.assert_raises(InternalOSError):
|
||||
self.do_commit()
|
||||
|
||||
def test_index(self):
|
||||
with open(os.path.join(self.repository.path, 'index.0'), 'wb') as fd:
|
||||
with open(os.path.join(self.repository.path, 'index.1'), 'wb') as fd:
|
||||
fd.write(b'123456789')
|
||||
self.do_commit()
|
||||
|
||||
def test_index_outside_transaction(self):
|
||||
with open(os.path.join(self.repository.path, 'index.0'), 'wb') as fd:
|
||||
with open(os.path.join(self.repository.path, 'index.1'), 'wb') as fd:
|
||||
fd.write(b'123456789')
|
||||
with self.repository:
|
||||
assert len(self.repository) == 1
|
||||
|
||||
def test_unreadable_index(self):
|
||||
index = os.path.join(self.repository.path, 'index.0')
|
||||
index = os.path.join(self.repository.path, 'index.1')
|
||||
os.unlink(index)
|
||||
os.mkdir(index)
|
||||
with self.assert_raises(InternalOSError):
|
||||
|
|
|
|||
Loading…
Reference in a new issue