Skip to content

Commit

Permalink
Remove some secrets tests that were accidentally included
Browse files Browse the repository at this point in the history
  • Loading branch information
wallyworld committed Nov 29, 2023
1 parent 06b2faa commit c0efa4e
Showing 1 changed file with 0 additions and 28 deletions.
28 changes: 0 additions & 28 deletions worker/uniter/runner/context/context_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1254,34 +1254,6 @@ func (s *HookContextSuite) TestSecretGet(c *gc.C) {
})
}

func (s *HookContextSuite) TestSecretGetOwnedSecretFailedBothURIAndLabel(c *gc.C) {
defer s.setupMocks(c).Finish()

uri := coresecrets.NewURI()
hookContext := context.NewMockUnitHookContext(s.mockUnit, model.IAAS, s.mockLeadership)
context.SetEnvironmentHookContextSecret(hookContext, uri.String(),
map[string]jujuc.SecretMetadata{
uri.ID: {Label: "label", Owner: s.mockUnit.Tag()},
}, nil, nil)

_, err := hookContext.GetSecret(uri, "label", false, false)
c.Assert(err, gc.ErrorMatches, `either URI or label should be used for getting an owned secret but not both`)
}

func (s *HookContextSuite) TestSecretGetOwnedSecretFailedWithUpdate(c *gc.C) {
defer s.setupMocks(c).Finish()

uri := coresecrets.NewURI()
hookContext := context.NewMockUnitHookContext(s.mockUnit, model.IAAS, s.mockLeadership)
context.SetEnvironmentHookContextSecret(hookContext, uri.String(),
map[string]jujuc.SecretMetadata{
uri.ID: {Label: "label", Owner: s.mockUnit.Tag()},
}, nil, nil)

_, err := hookContext.GetSecret(nil, "label", true, false)
c.Assert(err, gc.ErrorMatches, `secret owner cannot use --refresh`)
}

func (s *HookContextSuite) assertSecretGetOwnedSecretURILookup(
c *gc.C, patchContext func(*context.HookContext, *coresecrets.URI, string, api.SecretsAccessor, secrets.BackendsClient),
) {
Expand Down

0 comments on commit c0efa4e

Please sign in to comment.