MCPcopy Create free account
hub / github.com/containers/image / TestReferenceNewImage

Function TestReferenceNewImage

docker/docker_transport_test.go:208–226  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

206}
207
208func TestReferenceNewImage(t *testing.T) {
209 sysCtx := &types.SystemContext{
210 RegistriesDirPath: "/this/does/not/exist",
211 DockerPerHostCertDirPath: "/this/does/not/exist",
212 ArchitectureChoice: "amd64",
213 OSChoice: "linux",
214 }
215 ref, err := ParseReference("//quay.io/libpod/busybox")
216 require.NoError(t, err)
217 img, err := ref.NewImage(context.Background(), sysCtx)
218 require.NoError(t, err)
219 defer img.Close()
220
221 // unknownDigest case should return error
222 ref, err = ParseReference("//quay.io/libpod/busybox" + unknownDigestSuffixTest)
223 require.NoError(t, err)
224 _, err = ref.NewImage(context.Background(), sysCtx)
225 assert.Error(t, err)
226}
227
228func TestReferenceNewImageSource(t *testing.T) {
229 sysCtx := &types.SystemContext{

Callers

nothing calls this directly

Calls 4

ParseReferenceFunction · 0.70
NewImageMethod · 0.65
CloseMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…