3 Star 1 Fork 1

Gitee 极速下载/RPC-Turbo

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/vaporz/turbo
克隆/下载
thriftclient_test.go 938 Bytes
一键复制 编辑 原始数据 按行查看 历史
xiaozhang 提交于 2019-06-17 16:00 +08:00 . upgrade thrift to 0.12
package turbo
import (
"testing"
"github.com/apache/thrift/lib/go/thrift"
logger "github.com/sirupsen/logrus"
"github.com/stretchr/testify/assert"
)
func TestThriftInit(t *testing.T) {
defer func() {
if err := recover(); err != nil {
assert.Fail(t, "should not panic")
}
}()
s := &ThriftServer{tClient: new(thriftClient)}
s.tClient.thriftService = make(map[string]interface{})
s.tClient.init("", func(thrift.TTransport, thrift.TProtocolFactory) map[string]interface{} { return nil })
}
func TestThriftClose(t *testing.T) {
s := &ThriftServer{tClient: new(thriftClient)}
err := s.tClient.close()
assert.Nil(t, err)
}
func TestThriftService(t *testing.T) {
defer func() {
if err := recover(); err != nil {
assert.Equal(t, "thrift connection not initiated!", err.(*logger.Entry).Message)
} else {
t.Errorf("The code did not panic")
}
}()
s := &ThriftServer{tClient: new(thriftClient)}
s.Service("")
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mirrors/RPC-Turbo.git
git@gitee.com:mirrors/RPC-Turbo.git
mirrors
RPC-Turbo
RPC-Turbo
master

搜索帮助