本文整理汇总了Golang中github.com/juju/juju/api/base/testing.CheckingAPICaller函数的典型用法代码示例。如果您正苦于以下问题:Golang CheckingAPICaller函数的具体用法?Golang CheckingAPICaller怎么用?Golang CheckingAPICaller使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了CheckingAPICaller函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: init
func (s *SpacesSuite) init(c *gc.C, args *apitesting.CheckArgs, err error) {
s.called = 0
s.apiCaller = apitesting.CheckingAPICaller(c, args, &s.called, err)
s.api = spaces.NewAPI(s.apiCaller)
c.Check(s.api, gc.NotNil)
c.Check(s.called, gc.Equals, 0)
}
示例2: TestNewAPISuccess
func (s *SpacesSuite) TestNewAPISuccess(c *gc.C) {
var called int
apiCaller := apitesting.CheckingAPICaller(c, nil, &called, nil)
api := spaces.NewAPI(apiCaller)
c.Check(api, gc.NotNil)
c.Check(called, gc.Equals, 0)
}
示例3: prepareAPICall
func (s *SubnetsSuite) prepareAPICall(c *gc.C, args *apitesting.CheckArgs, err error) {
s.called = 0
s.apiCaller = apitesting.CheckingAPICaller(c, args, &s.called, err)
s.api = subnets.NewAPI(s.apiCaller)
c.Check(s.api, gc.NotNil)
c.Check(s.called, gc.Equals, 0)
}
示例4: clientErrorAPICaller
func clientErrorAPICaller(c *gc.C, method string, expectArgs interface{}, numCalls *int) base.APICaller {
args := &apitesting.CheckArgs{
Facade: "InstancePoller",
VersionIsZero: true,
IdIsEmpty: true,
Method: method,
Args: expectArgs,
}
return apitesting.CheckingAPICaller(c, args, numCalls, errors.New("client error!"))
}
示例5: successAPICaller
func successAPICaller(c *gc.C, method string, expectArgs, useResults interface{}, numCalls *int) base.APICaller {
args := &apitesting.CheckArgs{
Facade: "InstancePoller",
VersionIsZero: true,
IdIsEmpty: true,
Method: method,
Args: expectArgs,
Results: useResults,
}
return apitesting.CheckingAPICaller(c, args, numCalls, nil)
}