MCPcopy Index your code
hub / github.com/docker/docker-agent / TestPullIntegration

Function TestPullIntegration

pkg/remote/pull_test.go:434–462  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

432}
433
434func TestPullIntegration(t *testing.T) {
435 t.Parallel()
436
437 store, err := content.NewStore(content.WithBaseDir(t.TempDir()))
438 require.NoError(t, err)
439
440 testData := []byte("test pull integration")
441 layer := static.NewLayer(testData, types.OCIUncompressedLayer)
442 img := empty.Image
443 img, err = mutate.AppendLayers(img, layer)
444 require.NoError(t, err)
445
446 testRef := "pull-test:latest"
447 digest, err := store.StoreArtifact(img, testRef)
448 require.NoError(t, err)
449
450 t.Cleanup(func() {
451 if err := store.DeleteArtifact(digest); err != nil {
452 t.Logf("Failed to clean up artifact: %v", err)
453 }
454 })
455
456 retrievedImg, err := store.GetArtifactImage(testRef)
457 require.NoError(t, err)
458 assert.NotNil(t, retrievedImg)
459
460 err = Push(t.Context(), "invalid:reference:with:too:many:colons")
461 require.Error(t, err)
462}
463
464func TestNormalizeReference(t *testing.T) {
465 t.Parallel()

Callers

nothing calls this directly

Calls 9

StoreArtifactMethod · 0.95
DeleteArtifactMethod · 0.95
GetArtifactImageMethod · 0.95
NewStoreFunction · 0.92
WithBaseDirFunction · 0.92
PushFunction · 0.85
ContextMethod · 0.80
CleanupMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected