aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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)
}