tstor/config/config_test.go

28 lines
442 B
Go
Raw Normal View History

2021-04-04 17:24:58 +00:00
package config
import (
"io/ioutil"
"os"
"testing"
"github.com/stretchr/testify/require"
"gopkg.in/yaml.v3"
)
func TestTemplateConfig(t *testing.T) {
t.Parallel()
require := require.New(t)
f, err := os.Open("../templates/config_template.yaml")
require.NoError(err)
b, err := ioutil.ReadAll(f)
require.NoError(err)
conf := &Root{}
err = yaml.Unmarshal(b, conf)
require.NoError(err)
require.Equal(DefaultConfig(), conf)
}