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

Method test_meta

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

Source from the content-addressed store, hash-verified

104 assert cache.hits == 2
105
106 def test_meta(self, cache: RepositoryCache):
107 # Same as test_simple, but not reading the chunk data (metadata only).
108 # Single get()s are not cached, since they are used for unique objects like archives.
109 assert pdchunk(cache.get(H(1), read_data=False)) == b""
110 assert cache.misses == 1
111 assert cache.hits == 0
112
113 assert [pdchunk(ch) for ch in cache.get_many([H(1)], read_data=False)] == [b""]
114 assert cache.misses == 2
115 assert cache.hits == 0
116
117 assert [pdchunk(ch) for ch in cache.get_many([H(1)], read_data=False)] == [b""]
118 assert cache.misses == 2
119 assert cache.hits == 1
120
121 assert pdchunk(cache.get(H(1), read_data=False)) == b""
122 assert cache.misses == 2
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""]

Callers

nothing calls this directly

Calls 4

pdchunkFunction · 0.70
HFunction · 0.70
getMethod · 0.45
get_manyMethod · 0.45

Tested by

no test coverage detected