aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Duncan <pabs@pablotron.org>2022-03-19 23:02:08 -0400
committerPaul Duncan <pabs@pablotron.org>2022-03-19 23:02:08 -0400
commitd05eb19e1493422400f31a6d030eb1c9f8bb890c (patch)
treed46433b32bd598dc81f256ed5f349fc407810180
parent253e4a1a72a195ea9ca9db49c9e456030dc9425e (diff)
downloadcvez-d05eb19e1493422400f31a6d030eb1c9f8bb890c.tar.bz2
cvez-d05eb19e1493422400f31a6d030eb1c9f8bb890c.zip
nvdmirror/syncconfig_test.go: fix TestSyncConfigGetMetas()
-rw-r--r--nvdmirror/syncconfig_test.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/nvdmirror/syncconfig_test.go b/nvdmirror/syncconfig_test.go
index 91c900d..c00302b 100644
--- a/nvdmirror/syncconfig_test.go
+++ b/nvdmirror/syncconfig_test.go
@@ -163,29 +163,29 @@ func TestSyncConfigGetCweListUrl(t *testing.T) {
}
}
-func TestSyncConfigGetMetaUrls(t *testing.T) {
+func TestSyncConfigGetMetas(t *testing.T) {
// declare expected result
- exp := make(map[string]string)
+ exp := make(map[string]Update)
// add years
for year := 2002; year <= time.Now().Year(); year++ {
k := fmt.Sprintf("%s/nvdcve-1.1-%04d.meta", testBaseUrl, year)
v := fmt.Sprintf("%s/nvdcve-1.1-%04d.json.gz", testBaseUrl, year)
- exp[k] = v
+ exp[k] = Update { Type: UpdateCveYear, Year: year, Url: v }
}
// add cve extra feeds
for _, id := range([]string { "modified", "recent" }) {
k := fmt.Sprintf("%s/nvdcve-1.1-%s.meta", testBaseUrl, id)
v := fmt.Sprintf("%s/nvdcve-1.1-%s.json.gz", testBaseUrl, id)
- exp[k] = v
+ exp[k] = Update { Type: UpdateCveMeta, Meta: id, Url: v }
}
{
// add cpe match
k := fmt.Sprintf("%s/nvdcpematch-1.0.meta", testBaseUrl)
v := fmt.Sprintf("%s/nvdcpematch-1.0.json.gz", testBaseUrl)
- exp[k] = v
+ exp[k] = Update { Type: UpdateCpeMatch, Url: v }
}
// declare custom config
@@ -194,8 +194,8 @@ func TestSyncConfigGetMetaUrls(t *testing.T) {
CpeMatch10BaseUrl: testBaseUrl,
}
- // get/check meta urls
- got := config.getMetaUrls()
+ // get/check metas
+ got := config.getMetas()
if !reflect.DeepEqual(got, exp) {
t.Errorf("got \"%v\", exp \"%v\"", got, exp)
}