~juju-qa/ubuntu/xenial/juju/2.0-rc2

« back to all changes in this revision

Viewing changes to src/github.com/juju/juju/cmd/juju/model/grantrevoke_test.go

  • Committer: Nicholas Skaggs
  • Date: 2016-09-30 14:39:30 UTC
  • mfrom: (1.8.1)
  • Revision ID: nicholas.skaggs@canonical.com-20160930143930-vwwhrefh6ftckccy
import upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
        jc "github.com/juju/testing/checkers"
9
9
        gc "gopkg.in/check.v1"
10
10
 
11
 
        "github.com/juju/juju/apiserver/params"
 
11
        "github.com/juju/juju/apiserver/common"
12
12
        "github.com/juju/juju/cmd/juju/model"
13
13
        "github.com/juju/juju/jujuclient"
14
14
        "github.com/juju/juju/jujuclient/jujuclienttesting"
82
82
}
83
83
 
84
84
func (s *grantRevokeSuite) TestBlockGrant(c *gc.C) {
85
 
        s.fake.err = &params.Error{Code: params.CodeOperationBlocked}
 
85
        s.fake.err = common.OperationBlockedError("TestBlockGrant")
86
86
        _, err := s.run(c, "sam", "read", "foo")
87
 
        c.Assert(err, gc.Equals, cmd.ErrSilent)
88
 
        c.Check(c.GetTestLog(), jc.Contains, "To enable changes")
 
87
        testing.AssertOperationWasBlocked(c, err, ".*TestBlockGrant.*")
89
88
}
90
89
 
91
90
type grantSuite struct {