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

Function assertImageHasBPLayer

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

Source from the content-addressed store, hash-verified

2036}
2037
2038func assertImageHasBPLayer(t *testing.T, image *fakes.Image, bp buildpack.BuildModule) {
2039 t.Helper()
2040
2041 dirPath := fmt.Sprintf("/cnb/buildpacks/%s/%s", bp.Descriptor().Info().ID, bp.Descriptor().Info().Version)
2042 layerTar, err := image.FindLayerWithPath(dirPath)
2043 h.AssertNil(t, err)
2044
2045 h.AssertOnTarEntry(t, layerTar, dirPath,
2046 h.IsDirectory(),
2047 )
2048
2049 h.AssertOnTarEntry(t, layerTar, path.Dir(dirPath),
2050 h.IsDirectory(),
2051 )
2052
2053 h.AssertOnTarEntry(t, layerTar, dirPath+"/bin/build",
2054 h.ContentEquals("build-contents"),
2055 )
2056
2057 h.AssertOnTarEntry(t, layerTar, dirPath+"/bin/detect",
2058 h.ContentEquals("detect-contents"),
2059 )
2060}
2061
2062func assertImageHasExtLayer(t *testing.T, image *fakes.Image, ext buildpack.BuildModule) {
2063 t.Helper()

Callers 1

testBuilderFunction · 0.85

Calls 2

InfoMethod · 0.65
DescriptorMethod · 0.65

Tested by

no test coverage detected