test: removes latest license list test (#3559)

Signed-off-by: Christopher Phillips <32073428+spiffcs@users.noreply.github.com>
This commit is contained in:
Christopher Angelo Phillips 2025-01-02 15:56:44 -05:00 committed by GitHub
parent 286182a66f
commit f9ffe7252e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,37 +0,0 @@
package integration
import (
"encoding/json"
"net/http"
"testing"
"github.com/stretchr/testify/assert"
"github.com/anchore/syft/internal/spdxlicense"
)
func TestSPDXLicenseListIsTheLatest(t *testing.T) {
resp, err := http.Get("https://spdx.org/licenses/licenses.json")
if err != nil {
t.Fatalf("unable to get licenses list: %+v", err)
}
type licenseList struct {
Version string `json:"licenseListVersion"`
Licenses []struct {
ID string `json:"licenseId"`
Name string `json:"name"`
Text string `json:"licenseText"`
Deprecated bool `json:"isDeprecatedLicenseId"`
OSIApproved bool `json:"isOsiApproved"`
SeeAlso []string `json:"seeAlso"`
} `json:"licenses"`
}
var latest licenseList
if err = json.NewDecoder(resp.Body).Decode(&latest); err != nil {
t.Fatalf("unable to decode license list: %+v", err)
}
assert.Equal(t, latest.Version, spdxlicense.Version)
}