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

Function test_cache_chunk_buffer

src/borg/testsuite/archive_test.py:161–174  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

159
160
161def test_cache_chunk_buffer():
162 data = [Item(path="p1"), Item(path="p2")]
163 cache = MockCache()
164 key = PlaintextKey(None)
165 chunks = CacheChunkBuffer(cache, key, None)
166 for d in data:
167 chunks.add(d)
168 chunks.flush()
169 chunks.flush(flush=True)
170 assert len(chunks.chunks) == 2
171 unpacker = msgpack.Unpacker()
172 for id in chunks.chunks:
173 unpacker.feed(cache.objects[id])
174 assert data == [Item(internal_dict=d) for d in unpacker]
175
176
177def test_partial_cache_chunk_buffer():

Callers

nothing calls this directly

Calls 6

MockCacheClass · 0.85
PlaintextKeyClass · 0.85
CacheChunkBufferClass · 0.85
feedMethod · 0.80
addMethod · 0.45
flushMethod · 0.45

Tested by

no test coverage detected