You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
telegabber/config/config_test.go

27 lines
515 B

package config
import (
"testing"
)
func TestNoConfig(t *testing.T) {
_, err := ReadConfig("../test/sfklase.yml")
if err == nil {
t.Errorf("Non-existent config was successfully read")
}
}
func TestGoodConfig(t *testing.T) {
_, err := ReadConfig("../test/good_config.yml")
if err != nil {
t.Errorf("Good config is not accepted: %v", err)
}
}
func TestBadConfig(t *testing.T) {
_, err := ReadConfig("../test/bad_config.yml")
if err == nil {
t.Errorf("Bad config is accepted but it shoudn't!")
}
}