MCPcopy
hub / github.com/borgbackup/borg / test_basic_operations

Function test_basic_operations

src/borg/testsuite/legacyrepository_test.py:120–136  ·  view source on GitHub ↗
(repo_fixtures, request)

Source from the content-addressed store, hash-verified

118
119
120def test_basic_operations(repo_fixtures, request):
121 with get_repository_from_fixture(repo_fixtures, request) as repository:
122 for x in range(100):
123 repository.put(H(x), fchunk(b"SOMEDATA"))
124 key50 = H(50)
125 assert pdchunk(repository.get(key50)) == b"SOMEDATA"
126 repository.delete(key50)
127 with pytest.raises(LegacyRepository.ObjectNotFound):
128 repository.get(key50)
129 repository.commit(compact=False)
130 with reopen(repository) as repository:
131 with pytest.raises(LegacyRepository.ObjectNotFound):
132 repository.get(key50)
133 for x in range(100):
134 if x == 50:
135 continue
136 assert pdchunk(repository.get(H(x))) == b"SOMEDATA"
137
138
139def test_multiple_transactions(repo_fixtures, request):

Callers

nothing calls this directly

Calls 9

HFunction · 0.70
fchunkFunction · 0.70
pdchunkFunction · 0.70
reopenFunction · 0.70
putMethod · 0.45
getMethod · 0.45
deleteMethod · 0.45
commitMethod · 0.45

Tested by

no test coverage detected