1
0
mirror of synced 2024-11-25 06:26:03 +03:00
mg-transport-api-client-go/v1/storage_test.go
2024-02-12 14:55:05 +03:00

32 lines
584 B
Go

package v1
import (
"testing"
"github.com/stretchr/testify/suite"
)
type StorageTest struct {
suite.Suite
}
func TestStorage(t *testing.T) {
suite.Run(t, new(StorageTest))
}
func (t *StorageTest) Test_MGClientPool() {
clientPool, err := NewMGClientPool(1)
t.Assert().NoError(err)
client := clientPool.Get("test_token", "test_url")
t.Assert().Equal("test_url", client.URL)
clientPool.Remove("test_token")
clientPool.Close()
}
func (t *StorageTest) Test_NegativeCapacity() {
_, err := NewMGClientPool(-1)
t.Assert().Equal(ErrNegativeCapacity.Error(), err.Error())
}