~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/destroy_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:
13
13
        gc "gopkg.in/check.v1"
14
14
        "gopkg.in/juju/names.v2"
15
15
 
16
 
        "github.com/juju/juju/apiserver/params"
 
16
        "github.com/juju/juju/apiserver/common"
17
17
        "github.com/juju/juju/cmd/juju/model"
18
18
        "github.com/juju/juju/cmd/modelcmd"
19
19
        cmdtesting "github.com/juju/juju/cmd/testing"
191
191
}
192
192
 
193
193
func (s *DestroySuite) TestBlockedDestroy(c *gc.C) {
194
 
        s.api.err = &params.Error{Code: params.CodeOperationBlocked}
195
 
        s.runDestroyCommand(c, "test2", "-y")
196
 
        c.Check(c.GetTestLog(), jc.Contains, "To enable the command")
 
194
        s.api.err = common.OperationBlockedError("TestBlockedDestroy")
 
195
        _, err := s.runDestroyCommand(c, "test2", "-y")
 
196
        testing.AssertOperationWasBlocked(c, err, ".*TestBlockedDestroy.*")
197
197
}