예제 #1
0
파일: tools_test.go 프로젝트: kapilt/juju
func (s *toolsSuite) TestFindToolsNotFound(c *gc.C) {
	s.PatchValue(common.EnvtoolsFindTools, func(g environs.ConfigGetter, major, minor int, filter coretools.Filter, allowRetry bool) (list coretools.List, err error) {
		return nil, errors.NotFoundf("tools")
	})
	result, err := common.FindTools(s.State, params.FindToolsParams{})
	c.Assert(err, gc.IsNil)
	c.Assert(result.Error, jc.Satisfies, params.IsCodeNotFound)
}
예제 #2
0
파일: tools_test.go 프로젝트: kapilt/juju
func (s *toolsSuite) TestFindTools(c *gc.C) {
	list := coretools.List{&coretools.Tools{Version: version.Current}}
	s.PatchValue(common.EnvtoolsFindTools, func(g environs.ConfigGetter, major, minor int, filter coretools.Filter, allowRetry bool) (coretools.List, error) {
		c.Assert(major, gc.Equals, 123)
		c.Assert(minor, gc.Equals, 456)
		c.Assert(filter.Number, gc.Equals, version.Current.Number)
		c.Assert(filter.Series, gc.Equals, "win81")
		c.Assert(filter.Arch, gc.Equals, "alpha")
		return list, nil
	})
	result, err := common.FindTools(s.State, params.FindToolsParams{
		Number:       version.Current.Number,
		MajorVersion: 123,
		MinorVersion: 456,
		Series:       "win81",
		Arch:         "alpha",
	})
	c.Assert(err, gc.IsNil)
	c.Assert(result.List, gc.DeepEquals, list)
}
예제 #3
0
파일: client.go 프로젝트: kapilt/juju
// FindTools returns a List containing all tools matching the given parameters.
func (c *Client) FindTools(args params.FindToolsParams) (params.FindToolsResult, error) {
	return common.FindTools(c.api.state, args)
}
예제 #4
0
파일: provisioner.go 프로젝트: kapilt/juju
// FindTools returns a List containing all tools matching the given parameters.
func (p *ProvisionerAPI) FindTools(args params.FindToolsParams) (params.FindToolsResult, error) {
	return common.FindTools(p.st, args)
}