mirror of
https://github.com/anchore/syft.git
synced 2026-11-02 15:36:41 +01:00
fix: update field plurality of 8.0.0 schema before release (#1820)
to keep things consistent across the schema we want Locations and URLs to be plural fields now that they are fields on the License struct --------- Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
This commit is contained in:
@@ -684,7 +684,7 @@ func TestSinglePackageDetails(t *testing.T) {
|
||||
test.expected.Locations = source.NewLocationSet(fixtureLocation)
|
||||
licenses := test.expected.Licenses.ToSlice()
|
||||
for i := range licenses {
|
||||
licenses[i].Location.Add(fixtureLocation)
|
||||
licenses[i].Locations.Add(fixtureLocation)
|
||||
}
|
||||
test.expected.Licenses = pkg.NewLicenseSet(licenses...)
|
||||
pkgtest.TestFileParser(t, test.fixture, parseApkDB, []pkg.Package{test.expected}, nil)
|
||||
|
||||
@@ -35,8 +35,8 @@ func Test_LocalLicenseSearch(t *testing.T) {
|
||||
Value: "Apache-2.0",
|
||||
SPDXExpression: "Apache-2.0",
|
||||
Type: license.Concluded,
|
||||
Location: source.NewLocationSet(loc1),
|
||||
URL: internal.NewStringSet(),
|
||||
Locations: source.NewLocationSet(loc1),
|
||||
URLs: internal.NewStringSet(),
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -46,8 +46,8 @@ func Test_LocalLicenseSearch(t *testing.T) {
|
||||
Value: "MIT",
|
||||
SPDXExpression: "MIT",
|
||||
Type: license.Concluded,
|
||||
Location: source.NewLocationSet(loc2),
|
||||
URL: internal.NewStringSet(),
|
||||
Locations: source.NewLocationSet(loc2),
|
||||
URLs: internal.NewStringSet(),
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -126,8 +126,8 @@ func Test_RemoteProxyLicenseSearch(t *testing.T) {
|
||||
Value: "Apache-2.0",
|
||||
SPDXExpression: "Apache-2.0",
|
||||
Type: license.Concluded,
|
||||
Location: source.NewLocationSet(loc1),
|
||||
URL: internal.NewStringSet(),
|
||||
Locations: source.NewLocationSet(loc1),
|
||||
URLs: internal.NewStringSet(),
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -137,8 +137,8 @@ func Test_RemoteProxyLicenseSearch(t *testing.T) {
|
||||
Value: "MIT",
|
||||
SPDXExpression: "MIT",
|
||||
Type: license.Concluded,
|
||||
Location: source.NewLocationSet(loc2),
|
||||
URL: internal.NewStringSet(),
|
||||
Locations: source.NewLocationSet(loc2),
|
||||
URLs: internal.NewStringSet(),
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -135,7 +135,7 @@ func TestParseInstalledJsonComposerV1(t *testing.T) {
|
||||
expectedPkgs[i].Locations = locations
|
||||
locationLicenses := pkg.NewLicenseSet()
|
||||
for _, license := range expectedPkgs[i].Licenses.ToSlice() {
|
||||
license.Location = locations
|
||||
license.Locations = locations
|
||||
locationLicenses.Add(license)
|
||||
}
|
||||
expectedPkgs[i].Licenses = locationLicenses
|
||||
|
||||
Reference in New Issue
Block a user