forked from p53841790/wheat-cache
test(transport): add test hash
This commit is contained in:
parent
e81124c7e6
commit
fc60b2a779
|
@ -0,0 +1,17 @@
|
|||
package transport
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestHashTransport_GetTargetAddr(t *testing.T) {
|
||||
tran := NewHashTransport(3, nil, "127.0.0.1:5581", "127.0.0.1:5582", "127.0.0.1:5583")
|
||||
|
||||
key := "test"
|
||||
|
||||
target, err := tran.GetTargetAddr(key)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, target, "127.0.0.1:5582")
|
||||
}
|
Loading…
Reference in New Issue