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

Method test_simple

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

Source from the content-addressed store, hash-verified

86 return RepositoryCache(repository)
87
88 def test_simple(self, cache: RepositoryCache):
89 # Single get()s are not cached, since they are used for unique objects like archives.
90 assert pdchunk(cache.get(H(1))) == b"1234"
91 assert cache.misses == 1
92 assert cache.hits == 0
93
94 assert [pdchunk(ch) for ch in cache.get_many([H(1)])] == [b"1234"]
95 assert cache.misses == 2
96 assert cache.hits == 0
97
98 assert [pdchunk(ch) for ch in cache.get_many([H(1)])] == [b"1234"]
99 assert cache.misses == 2
100 assert cache.hits == 1
101
102 assert pdchunk(cache.get(H(1))) == b"1234"
103 assert cache.misses == 2
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).

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