forked from TrueCloudLab/frostfs-api-go
[#259] netmap: Implement JSON encoding for NetworkInfo RPC messages
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
276d863fd5
commit
9eda317efe
2 changed files with 32 additions and 0 deletions
|
@ -66,3 +66,15 @@ func TestNodeInfoJSON(t *testing.T) {
|
|||
|
||||
require.Equal(t, i, i2)
|
||||
}
|
||||
|
||||
func TestNetworkInfoJSON(t *testing.T) {
|
||||
i := generateNetworkInfo()
|
||||
|
||||
data, err := i.MarshalJSON()
|
||||
require.NoError(t, err)
|
||||
|
||||
i2 := new(netmap.NetworkInfo)
|
||||
require.NoError(t, i2.UnmarshalJSON(data))
|
||||
|
||||
require.Equal(t, i, i2)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue