Skip to content

Commit

Permalink
test: add nonspdx default licenses test
Browse files Browse the repository at this point in the history
Signed-off-by: Christopher Phillips <[email protected]>
  • Loading branch information
spiffcs committed Oct 3, 2024
1 parent 629ab9d commit 819ecf3
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions grant/evalutation/license_evaluation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,22 @@ func Test_checkLicense(t *testing.T) {
}},
},
},
{
name: "should reject denied licenses when CheckNonSPDX is also false",
license: grant.License{Name: "foobar"},
// Only allow OSI licenses.
config: EvaluationConfig{CheckNonSPDX: false, Policy: grant.DefaultPolicy()},
wants: struct {
Pass bool
Reasons []Reason
}{
Pass: false,
Reasons: []Reason{{
Detail: ReasonLicenseDeniedPolicy,
RuleName: "default-deny-all",
}},
},
},
{
name: "non-OSI approved licenses should be denied when EvaluationConfig.OsiApproved is true",
license: grant.License{
Expand Down

0 comments on commit 819ecf3

Please sign in to comment.