MCPcopy Create free account
hub / github.com/buildpacks/pack / assertImageHasExtLayer

Function assertImageHasExtLayer

internal/builder/builder_test.go:2062–2084  ·  view source on GitHub ↗
(t *testing.T, image *fakes.Image, ext buildpack.BuildModule)

Source from the content-addressed store, hash-verified

2060}
2061
2062func assertImageHasExtLayer(t *testing.T, image *fakes.Image, ext buildpack.BuildModule) {
2063 t.Helper()
2064
2065 dirPath := fmt.Sprintf("/cnb/extensions/%s/%s", ext.Descriptor().Info().ID, ext.Descriptor().Info().Version)
2066 layerTar, err := image.FindLayerWithPath(dirPath)
2067 h.AssertNil(t, err)
2068
2069 h.AssertOnTarEntry(t, layerTar, dirPath,
2070 h.IsDirectory(),
2071 )
2072
2073 h.AssertOnTarEntry(t, layerTar, path.Dir(dirPath),
2074 h.IsDirectory(),
2075 )
2076
2077 h.AssertOnTarEntry(t, layerTar, dirPath+"/bin/generate",
2078 h.ContentEquals("generate-contents"),
2079 )
2080
2081 h.AssertOnTarEntry(t, layerTar, dirPath+"/bin/detect",
2082 h.ContentEquals("detect-contents"),
2083 )
2084}
2085
2086func assertImageHasOrderBpLayer(t *testing.T, image *fakes.Image, bp buildpack.BuildModule) {
2087 t.Helper()

Callers 1

testBuilderFunction · 0.85

Calls 2

InfoMethod · 0.65
DescriptorMethod · 0.65

Tested by

no test coverage detected