0e3e8db5c0
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
32 lines
970 B
Go
32 lines
970 B
Go
package objectconfig_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/nspcc-dev/neofs-node/cmd/neofs-node/config"
|
|
objectconfig "github.com/nspcc-dev/neofs-node/cmd/neofs-node/config/object"
|
|
configtest "github.com/nspcc-dev/neofs-node/cmd/neofs-node/config/test"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestObjectSection(t *testing.T) {
|
|
t.Run("defaults", func(t *testing.T) {
|
|
empty := configtest.EmptyConfig()
|
|
|
|
require.Equal(t, objectconfig.PutPoolSizeDefault, objectconfig.Put(empty).PoolSizeRemote())
|
|
require.Equal(t, objectconfig.PutPoolSizeDefault, objectconfig.Put(empty).PoolSizeLocal())
|
|
})
|
|
|
|
const path = "../../../../config/example/node"
|
|
|
|
var fileConfigTest = func(c *config.Config) {
|
|
require.Equal(t, 100, objectconfig.Put(c).PoolSizeRemote())
|
|
require.Equal(t, 101, objectconfig.Put(c).PoolSizeLocal())
|
|
}
|
|
|
|
configtest.ForEachFileType(path, fileConfigTest)
|
|
|
|
t.Run("ENV", func(t *testing.T) {
|
|
configtest.ForEnvFileType(path, fileConfigTest)
|
|
})
|
|
}
|