diff options
Diffstat (limited to 'nvdmirror/syncconfig_test.go')
-rw-r--r-- | nvdmirror/syncconfig_test.go | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/nvdmirror/syncconfig_test.go b/nvdmirror/syncconfig_test.go index 5f57b2d..91c900d 100644 --- a/nvdmirror/syncconfig_test.go +++ b/nvdmirror/syncconfig_test.go @@ -141,6 +141,28 @@ func TestSyncConfigGetCisaKevcUrl(t *testing.T) { } } +func TestSyncConfigGetCweListUrl(t *testing.T) { + tests := []struct { + name string + val string + exp string + } { + { "custom", "https://example.com/", "https://example.com/" }, + { "default", "", DefaultConfig.CweListUrl }, + } + + for _, test := range(tests) { + t.Run(test.name, func(t *testing.T) { + config := SyncConfig { CweListUrl: test.val } + + got := config.GetCweListUrl() + if got != test.exp { + t.Errorf("got \"%s\", exp \"%s\"", got, test.exp) + } + }) + } +} + func TestSyncConfigGetMetaUrls(t *testing.T) { // declare expected result exp := make(map[string]string) |