frostfs-node/pkg/core/netmap/node/options_test.go
Stanislav Bogatyrev b7b5079934 Add Inner Ring code
2020-07-24 17:07:37 +03:00

24 lines
519 B
Go

package node
import (
"testing"
"github.com/nspcc-dev/neofs-api-go/object"
"github.com/stretchr/testify/require"
)
func TestInfo_Price(t *testing.T) {
var info Info
// too small value
info.opts = []string{"/Price:0.01048575"}
require.Equal(t, uint64(0), info.Price())
// min value
info.opts = []string{"/Price:0.01048576"}
require.Equal(t, uint64(1), info.Price())
// big value
info.opts = []string{"/Price:1000000000.666"}
require.Equal(t, uint64(1000000000.666*1e8/object.UnitsMB), info.Price())
}