mirror of
https://github.com/anchore/syft.git
synced 2026-10-30 14:02:26 +01:00
move source metadata upstream and fix tests
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
This commit is contained in:
@@ -37,7 +37,7 @@ func TestCatalogFromJSON(t *testing.T) {
|
||||
}
|
||||
|
||||
var buf bytes.Buffer
|
||||
jsonPres := json.NewPresenter(expectedCatalog, *s, *expectedDistro)
|
||||
jsonPres := json.NewPresenter(expectedCatalog, s.Metadata, *expectedDistro)
|
||||
if err = jsonPres.Present(&buf); err != nil {
|
||||
t.Fatalf("failed to write to presenter: %+v", err)
|
||||
}
|
||||
@@ -73,8 +73,6 @@ func TestCatalogFromJSON(t *testing.T) {
|
||||
a := actualPackages[i]
|
||||
|
||||
// omit fields that should be missing
|
||||
e.Locations = nil
|
||||
e.FoundBy = ""
|
||||
if e.MetadataType == pkg.JavaMetadataType {
|
||||
metadata := e.Metadata.(pkg.JavaMetadata)
|
||||
metadata.Parent = nil
|
||||
|
||||
@@ -67,7 +67,7 @@ func testJsonSchema(t *testing.T, catalog *pkg.Catalog, theScope *source.Source,
|
||||
t.Fatalf("bad distro: %+v", err)
|
||||
}
|
||||
|
||||
p := presenter.GetPresenter(presenter.JSONPresenter, *theScope, catalog, &d)
|
||||
p := presenter.GetPresenter(presenter.JSONPresenter, theScope.Metadata, catalog, &d)
|
||||
if p == nil {
|
||||
t.Fatal("unable to get presenter")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user