diff options
author | Paul Duncan <pabs@pablotron.org> | 2022-03-18 20:29:31 -0400 |
---|---|---|
committer | Paul Duncan <pabs@pablotron.org> | 2022-03-18 20:29:31 -0400 |
commit | 55c07615c624e3b55bb659ce43d372b938361dad (patch) | |
tree | 837e5ffa06beae873cb2961ed4b09c659ea2f106 /nvdmirror/syncconfig_test.go | |
parent | 02463f370d3b1f29b3c991eb90abc53705d37f12 (diff) | |
download | cvez-55c07615c624e3b55bb659ce43d372b938361dad.tar.bz2 cvez-55c07615c624e3b55bb659ce43d372b938361dad.zip |
nvdmirror: add CweListUrl
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) |