func (s *ClientSuite) AssertModelCall(c *gc.C, stub *jujutesting.Stub, tag names.ModelTag, call string, err error) { expectedArg := params.ModelArgs{ModelTag: tag.String()} stub.CheckCalls(c, []jujutesting.StubCall{ {"MigrationTarget." + call, []interface{}{"", expectedArg}}, }) c.Assert(err, gc.ErrorMatches, "boom") }
func (s *modelManagerSuite) modifyAccess(c *gc.C, user names.UserTag, action params.ModelAction, access params.ModelAccessPermission, model names.ModelTag) error { args := params.ModifyModelAccessRequest{ Changes: []params.ModifyModelAccess{{ UserTag: user.String(), Action: action, Access: access, ModelTag: model.String(), }}} result, err := s.modelmanager.ModifyModelAccess(args) c.Assert(err, jc.ErrorIsNil) return result.OneError() }