git.frostfs.info/TrueCloudLab/frostfs-sdk-go@v0.0.0-20241022124111-5361f0ecebd3/container/network_test.go (about)

     1  package container_test
     2  
     3  import (
     4  	"testing"
     5  
     6  	"git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container"
     7  	containertest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/test"
     8  	netmaptest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/netmap/test"
     9  	"github.com/stretchr/testify/require"
    10  )
    11  
    12  func TestContainer_NetworkConfig(t *testing.T) {
    13  	c := containertest.Container()
    14  	nc := netmaptest.NetworkInfo()
    15  
    16  	t.Run("default", func(t *testing.T) {
    17  		require.False(t, container.IsHomomorphicHashingDisabled(c))
    18  
    19  		res := container.AssertNetworkConfig(c, nc)
    20  
    21  		require.True(t, res)
    22  	})
    23  
    24  	nc.DisableHomomorphicHashing()
    25  
    26  	t.Run("apply", func(t *testing.T) {
    27  		require.False(t, container.IsHomomorphicHashingDisabled(c))
    28  
    29  		container.ApplyNetworkConfig(&c, nc)
    30  
    31  		require.True(t, container.IsHomomorphicHashingDisabled(c))
    32  	})
    33  }