Add basic unittests for the config related functionality

This commit is contained in:
Arturo Filastò 2018-06-22 11:01:15 +02:00
commit 1bba0c7899
5 changed files with 102 additions and 25 deletions

19
config/parser_test.go Normal file
View 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")
}
}