frostfs-node/cmd/neofs-node/config/logger/config_test.go
Alex Vanin 25a13d3611 [#493] cmd/node: Add .env file for tests
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-06-01 15:29:08 +03:00

30 lines
790 B
Go

package loggerconfig_test
import (
"testing"
"github.com/nspcc-dev/neofs-node/cmd/neofs-node/config"
loggerconfig "github.com/nspcc-dev/neofs-node/cmd/neofs-node/config/logger"
configtest "github.com/nspcc-dev/neofs-node/cmd/neofs-node/config/test"
"github.com/stretchr/testify/require"
)
func TestLoggerSection_Level(t *testing.T) {
t.Run("defaults", func(t *testing.T) {
v := loggerconfig.Level(configtest.EmptyConfig())
require.Equal(t, loggerconfig.LevelDefault, v)
})
const path = "../../../../config/example/node"
var fileConfigTest = func(c *config.Config) {
v := loggerconfig.Level(c)
require.Equal(t, "debug", v)
}
configtest.ForEachFileType(path, fileConfigTest)
t.Run("ENV", func(t *testing.T) {
configtest.ForEnvFileType(path, fileConfigTest)
})
}