github.com/juju/juju@v0.0.0-20240430160146-1752b71fcf00/environs/context/cloud_test.go (about) 1 // Copyright 2020 Canonical Ltd. 2 // Licensed under the AGPLv3, see LICENCE file for details. 3 4 package context 5 6 import ( 7 stdcontext "context" 8 9 "github.com/juju/errors" 10 "github.com/juju/testing" 11 gc "gopkg.in/check.v1" 12 ) 13 14 type CloudCallContextSuite struct { 15 testing.IsolationSuite 16 } 17 18 var _ = gc.Suite(&CloudCallContextSuite{}) 19 20 func (s *CloudCallContextSuite) TestCloudCallContext(c *gc.C) { 21 stdctx := stdcontext.TODO() 22 ctx := NewCloudCallContext(stdctx) 23 c.Assert(ctx, gc.NotNil) 24 c.Assert(ctx.Context, gc.Equals, stdctx) 25 26 err := ctx.InvalidateCredential("call") 27 c.Assert(errors.Is(err, errors.NotImplemented), gc.Equals, true) 28 }