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

39 lines
511 B
Go

package netmap
import (
"testing"
"github.com/stretchr/testify/require"
)
func TestNetMap_Nodes(t *testing.T) {
nm := New()
info1 := Info{}
info1.SetPublicKey([]byte{1, 2, 3})
info2 := Info{}
info2.SetPublicKey([]byte{4, 5, 6})
nodes := []Info{
info1,
info2,
}
nm.SetNodes(nodes)
require.Equal(t, nodes, nm.Nodes())
}
func TestNetMap_Root(t *testing.T) {
nm := New()
bucket := &Bucket{
Key: "key",
Value: "value",
}
nm.SetRoot(bucket)
require.Equal(t, bucket, nm.Root())
}