chore: Test for Server Config Read #14125

This commit is contained in:
Aleksandr Bezobchuk 2022-12-01 16:18:33 -05:00 committed by GitHub
parent 0c65734bbe
commit 9f46665d93
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -54,6 +54,18 @@ prefix = ""`
require.Contains(t, buffer.String(), expectedContents, "config file contents")
}
func TestReadConfig(t *testing.T) {
cfg := DefaultConfig()
tmpFile := filepath.Join(t.TempDir(), "config")
WriteConfigFile(tmpFile, cfg)
v := viper.New()
otherCfg, err := GetConfig(v)
require.NoError(t, err)
require.Equal(t, *cfg, otherCfg)
}
func TestIndexEventsWriteRead(t *testing.T) {
expected := []string{"key3", "key4"}