1
// Copyright 2014 Canonical Ltd.
2
// Licensed under the AGPLv3, see LICENCE file for details.
8
"github.com/juju/errors"
9
jc "github.com/juju/testing/checkers"
10
gc "gopkg.in/check.v1"
12
"github.com/juju/juju/cmd/juju/backups"
13
"github.com/juju/juju/testing"
16
type removeSuite struct {
21
var _ = gc.Suite(&removeSuite{})
23
func (s *removeSuite) SetUpTest(c *gc.C) {
24
s.BaseBackupsSuite.SetUpTest(c)
25
s.command = backups.NewRemoveCommandForTest()
28
func (s *removeSuite) TestOkay(c *gc.C) {
30
ctx, err := testing.RunCommand(c, s.command, "spam")
31
c.Check(err, jc.ErrorIsNil)
33
out := "successfully removed: spam\n"
34
s.checkStd(c, ctx, out, "")
37
func (s *removeSuite) TestError(c *gc.C) {
38
s.setFailure("failed!")
39
_, err := testing.RunCommand(c, s.command, "spam")
40
c.Check(errors.Cause(err), gc.ErrorMatches, "failed!")