Exemplo n.º 1
0
Arquivo: api.go Projeto: jameinel/core
func NewUserManagerClient(envName string) (*usermanager.Client, error) {
	st, err := newAPIClient(envName)
	if err != nil {
		return nil, err
	}
	return usermanager.NewClient(st), nil
}
Exemplo n.º 2
0
func (s *DeployLocalSuite) TestDeployOwnerTag(c *gc.C) {
	usermanager := usermanager.NewClient(s.APIState)
	err := usermanager.AddUser("foobar", "")
	c.Assert(err, gc.IsNil)
	service, err := juju.DeployService(s.State,
		juju.DeployServiceParams{
			ServiceName:  "bobwithowner",
			Charm:        s.charm,
			ServiceOwner: "user-foobar",
		})
	c.Assert(err, gc.IsNil)
	c.Assert(service.GetOwnerTag(), gc.Equals, "user-foobar")
}
Exemplo n.º 3
0
func (s *usermanagerSuite) SetUpTest(c *gc.C) {
	s.JujuConnSuite.SetUpTest(c)
	s.usermanager = usermanager.NewClient(s.APIState)
	c.Assert(s.usermanager, gc.NotNil)
}