Skip to content

Commit c4bd55a

Browse files
author
Array Fleet
committed
test: assert lowercase ghsaId normalization on CVE request path
Cover request_cve_for_repository_security_advisory alongside the existing update advisory normalization test.
1 parent 3dcf83b commit c4bd55a

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

pkg/github/security_advisories_test.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1141,6 +1141,21 @@ func Test_RequestCVEForRepositorySecurityAdvisory(t *testing.T) {
11411141
expectError: false,
11421142
expectedText: "CVE request submitted successfully",
11431143
},
1144+
{
1145+
name: "lowercase ghsaId normalized in CVE request path",
1146+
mockedClient: MockHTTPClientWithHandlers(map[string]http.HandlerFunc{
1147+
PostReposSecurityAdvisoriesCveByOwnerByRepoByGhsaID: expectPath(t, "/repos/octo/hello-world/security-advisories/GHSA-abcd-1234-5678/cve").andThen(
1148+
mockResponse(t, http.StatusOK, nil),
1149+
),
1150+
}),
1151+
requestArgs: map[string]any{
1152+
"owner": "octo",
1153+
"repo": "hello-world",
1154+
"ghsaId": "ghsa-abcd-1234-5678",
1155+
},
1156+
expectError: false,
1157+
expectedText: "CVE request submitted successfully",
1158+
},
11441159
{
11451160
name: "invalid ghsaId format",
11461161
mockedClient: MockHTTPClientWithHandlers(map[string]http.HandlerFunc{

0 commit comments

Comments
 (0)