-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
internal/database: add more tests for Load
Adds tests for Load failure cases, adds more context to error message, and adds an additional failure case. For golang/go#56417 Change-Id: If4927c11f433c931827b262ee65a04f3594a125a Reviewed-on: https://go-review.googlesource.com/c/vulndb/+/453175 Reviewed-by: Damien Neil <[email protected]> Reviewed-by: Jonathan Amsterdam <[email protected]> Run-TryBot: Tatiana Bradley <[email protected]> TryBot-Result: Gopher Robot <[email protected]>
- Loading branch information
Showing
14 changed files
with
581 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
internal/database/testdata/db/missing-file/ID/GO-1999-0001.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
{ | ||
"id": "GO-1999-0001", | ||
"published": "1999-01-01T00:00:00Z", | ||
"modified": "2001-01-01T00:00:00Z", | ||
"aliases": [ | ||
"CVE-1999-1111" | ||
], | ||
"details": "Some details", | ||
"affected": [ | ||
{ | ||
"package": { | ||
"name": "example.com/module", | ||
"ecosystem": "Go" | ||
}, | ||
"ranges": [ | ||
{ | ||
"type": "SEMVER", | ||
"events": [ | ||
{ | ||
"introduced": "0" | ||
}, | ||
{ | ||
"fixed": "1.1.0" | ||
}, | ||
{ | ||
"introduced": "1.2.0" | ||
}, | ||
{ | ||
"fixed": "1.2.2" | ||
} | ||
] | ||
} | ||
], | ||
"database_specific": { | ||
"url": "https://pkg.go.dev/vuln/GO-1999-0001" | ||
}, | ||
"ecosystem_specific": { | ||
"imports": [ | ||
{ | ||
"path": "package", | ||
"symbols": [ | ||
"Symbol" | ||
] | ||
} | ||
] | ||
} | ||
} | ||
], | ||
"references": [ | ||
{ | ||
"type": "FIX", | ||
"url": "https://example.com/cl/123" | ||
} | ||
] | ||
} |
Oops, something went wrong.