update tests

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2021-02-12 20:50:02 +03:00
parent 6e1f30e931
commit f92f3ca5f7
14 changed files with 59 additions and 78 deletions

View File

@@ -9,12 +9,11 @@ import (
"time"
"github.com/juju/ratelimit"
bmemory "github.com/unistack-org/micro-broker-memory/v3"
tmemory "github.com/unistack-org/micro-network-transport-memory"
rmemory "github.com/unistack-org/micro-register-memory/v3"
rrouter "github.com/unistack-org/micro-router-register/v3"
"github.com/unistack-org/micro/v3/broker"
"github.com/unistack-org/micro/v3/client"
"github.com/unistack-org/micro/v3/errors"
"github.com/unistack-org/micro/v3/network/transport"
"github.com/unistack-org/micro/v3/router"
"github.com/unistack-org/micro/v3/server"
)
@@ -29,8 +28,8 @@ func (t *testHandler) Method(ctx context.Context, req *TestRequest, rsp *TestRes
func TestRateClientLimit(t *testing.T) {
// setup
r := rmemory.NewRegister()
tr := tmemory.NewTransport()
r := register.NewRegister()
tr := transport.NewTransport()
testRates := []int{1, 10, 20}
for _, limit := range testRates {
@@ -72,9 +71,9 @@ func TestRateServerLimit(t *testing.T) {
testRates := []int{1, 5, 6, 10}
for _, limit := range testRates {
r := rmemory.NewRegister()
b := bmemory.NewBroker()
tr := tmemory.NewTransport()
r := register.NewRegister()
b := broker.NewBroker()
tr := transport.NewTransport()
_ = b
br := ratelimit.NewBucketWithRate(float64(limit), int64(limit))