integration: update tests to use scope instead of img directly

Signed-off-by: Alfredo Deza <adeza@anchore.com>
This commit is contained in:
Alfredo Deza 2020-07-10 09:14:57 -04:00
parent 69b01caba7
commit 429c28720c

View File

@ -8,6 +8,7 @@ import (
"github.com/anchore/go-testutils"
"github.com/anchore/imgbom/imgbom"
"github.com/anchore/imgbom/imgbom/distro"
"github.com/anchore/imgbom/imgbom/scope"
"github.com/go-test/deep"
)
@ -15,7 +16,12 @@ func TestDistroImage(t *testing.T) {
img, cleanup := testutils.GetFixtureImage(t, "docker-archive", "image-distro-id")
defer cleanup()
actual := imgbom.IdentifyDistro(img)
s, err := imgbom.GetScopeFromImage(img, scope.AllLayersScope)
if err != nil {
t.Fatalf("could not populate scope with image: %+v", err)
}
actual := imgbom.IdentifyDistro(s)
if actual == nil {
t.Fatalf("could not find distro")
}