MCPcopy
hub / github.com/google/go-containerregistry / TestAppendWithOCIBaseImage

Function TestAppendWithOCIBaseImage

pkg/crane/append_test.go:26–49  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

24)
25
26func TestAppendWithOCIBaseImage(t *testing.T) {
27 base := mutate.MediaType(empty.Image, types.OCIManifestSchema1)
28 img, err := crane.Append(base, "testdata/content.tar")
29
30 if err != nil {
31 t.Fatalf("crane.Append(): %v", err)
32 }
33
34 layers, err := img.Layers()
35
36 if err != nil {
37 t.Fatalf("img.Layers(): %v", err)
38 }
39
40 mediaType, err := layers[0].MediaType()
41
42 if err != nil {
43 t.Fatalf("layers[0].MediaType(): %v", err)
44 }
45
46 if got, want := mediaType, types.OCILayer; got != want {
47 t.Errorf("MediaType(): want %q, got %q", want, got)
48 }
49}
50
51func TestAppendWithDockerBaseImage(t *testing.T) {
52 img, err := crane.Append(empty.Image, "testdata/content.tar")

Callers

nothing calls this directly

Calls 4

MediaTypeFunction · 0.92
AppendFunction · 0.92
LayersMethod · 0.65
MediaTypeMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…