Add basic unittests for the config related functionality
This commit is contained in:
parent
2653a3f67f
commit
1bba0c7899
5 changed files with 102 additions and 25 deletions
19
config/parser_test.go
Normal file
19
config/parser_test.go
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
package config
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestParseConfig(t *testing.T) {
|
||||
config, err := ReadConfig("testdata/valid-config.json")
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
|
||||
if len(config.NettestGroups.Middlebox.EnabledTests) < 0 {
|
||||
t.Error("at least one middlebox test should be enabled")
|
||||
}
|
||||
if config.Advanced.IncludeCountry == false {
|
||||
t.Error("country should be included")
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue