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

Method test_mixed

src/borg/testsuite/remote_test.py:125–140  ·  view source on GitHub ↗
(self, cache: RepositoryCache)

Source from the content-addressed store, hash-verified

123 assert cache.hits == 2
124
125 def test_mixed(self, cache: RepositoryCache):
126 assert [pdchunk(ch) for ch in cache.get_many([H(1)], read_data=False)] == [b""]
127 assert cache.misses == 1
128 assert cache.hits == 0
129
130 assert [pdchunk(ch) for ch in cache.get_many([H(1)], read_data=True)] == [b"1234"]
131 assert cache.misses == 2
132 assert cache.hits == 0
133
134 assert [pdchunk(ch) for ch in cache.get_many([H(1)], read_data=False)] == [b""]
135 assert cache.misses == 2
136 assert cache.hits == 1
137
138 assert [pdchunk(ch) for ch in cache.get_many([H(1)], read_data=True)] == [b"1234"]
139 assert cache.misses == 2
140 assert cache.hits == 2
141
142 def test_backoff(self, cache: RepositoryCache):
143 def query_size_limit():

Callers

nothing calls this directly

Calls 3

pdchunkFunction · 0.70
HFunction · 0.70
get_manyMethod · 0.45

Tested by

no test coverage detected