MCPcopy
hub / github.com/kopia/kopia / verifyMetadataCompressor

Function verifyMetadataCompressor

snapshot/upload/upload_test.go:223–240  ·  view source on GitHub ↗
(t *testing.T, ctx context.Context, rep repo.Repository, entries []entry, comp compression.HeaderID)

Source from the content-addressed store, hash-verified

221}
222
223func verifyMetadataCompressor(t *testing.T, ctx context.Context, rep repo.Repository, entries []entry, comp compression.HeaderID) {
224 t.Helper()
225
226 for _, e := range entries {
227 cid, _, ok := e.objectID.ContentID()
228 if !assert.True(t, ok) {
229 continue
230 }
231
232 if !cid.HasPrefix() {
233 continue
234 }
235
236 info, err := rep.ContentInfo(ctx, cid)
237 require.NoError(t, err, "failed to get content info for %v", cid)
238 assert.Equal(t, comp, info.CompressionHeaderID)
239 }
240}
241
242func TestUploadMetadataCompression(t *testing.T) {
243 t.Parallel()

Callers 1

Calls 5

HelperMethod · 0.80
ContentIDMethod · 0.80
HasPrefixMethod · 0.80
EqualMethod · 0.80
ContentInfoMethod · 0.65

Tested by

no test coverage detected