MCPcopy Create free account
hub / github.com/docker/docker-agent / TestPushWithOptions

Function TestPushWithOptions

pkg/remote/push_test.go:58–77  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

56}
57
58func TestPushWithOptions(t *testing.T) {
59 t.Parallel()
60 store, err := content.NewStore(content.WithBaseDir(t.TempDir()))
61 require.NoError(t, err)
62
63 testData := []byte("test artifact data with options")
64
65 layer := static.NewLayer(testData, types.OCIUncompressedLayer)
66 img := empty.Image
67 img, err = mutate.AppendLayers(img, layer)
68 require.NoError(t, err)
69
70 testRef := "test-app-options:v1.0.0"
71 digest, err := store.StoreArtifact(img, testRef)
72 require.NoError(t, err)
73
74 if err := store.DeleteArtifact(digest); err != nil {
75 t.Logf("Failed to clean up artifact: %v", err)
76 }
77}
78
79func TestContentStore(t *testing.T) {
80 t.Parallel()

Callers

nothing calls this directly

Calls 4

StoreArtifactMethod · 0.95
DeleteArtifactMethod · 0.95
NewStoreFunction · 0.92
WithBaseDirFunction · 0.92

Tested by

no test coverage detected