frostfs-api-go/v2/netmap/json_test.go
Alex Vanin b681b28e33 [#172] v2/netmap: Add JSON converter for node info
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-10-20 13:45:14 +03:00

22 lines
432 B
Go

package netmap_test
import (
"testing"
"github.com/nspcc-dev/neofs-api-go/v2/netmap"
"github.com/stretchr/testify/require"
)
func TestNodeInfoJSON(t *testing.T) {
exp := generateNodeInfo("public key", "/multi/addr", 2)
t.Run("non empty", func(t *testing.T) {
data := netmap.NodeInfoToJSON(exp)
require.NotNil(t, data)
got := netmap.NodeInfoFromJSON(data)
require.NotNil(t, got)
require.Equal(t, exp, got)
})
}