Browse Source

Update config path

master
Jaeha Choi 3 months ago
parent
commit
c627595016
Signed by: Jaeha.Choi GPG Key ID: D6133D1D117FF503
  1. 10
      internal/server/server_test.go

10
internal/server/server_test.go

@ -12,35 +12,35 @@ func init() {
}
func TestReadConfigConf(t *testing.T) {
testConf, _ := readConfig("../config.yml")
testConf, _ := readConfig("../../config/config.yml")
if testConf == nil {
t.Error("readConfig returned nil")
}
}
func TestReadConfigError(t *testing.T) {
_, err := readConfig("../config.yml")
_, err := readConfig("../../config/config.yml")
if err != nil {
t.Error("readConfig returned error")
}
}
func TestReadConfigHost(t *testing.T) {
testConf, _ := readConfig("../config.yml")
testConf, _ := readConfig("../../config/config.yml")
if testConf.Server.Host != "127.0.0.1" {
t.Error("readConfig host incorrect")
}
}
func TestReadConfigPort(t *testing.T) {
testConf, _ := readConfig("../config.yml")
testConf, _ := readConfig("../../config/config.yml")
if testConf.Server.Port != 9129 {
t.Error("readConfig port incorrect")
}
}
func TestStartListener(t *testing.T) {
testConf, err := readConfig("../config.yml")
testConf, err := readConfig("../../config/config.yml")
if err != nil {
t.Error("readConfig returned error")
}

Loading…
Cancel
Save