func (s *DestroySuite) TestDestroyUnknownModelCallsRefresh(c *gc.C) { called := false refresh := func(jujuclient.ClientStore, string) error { called = true return nil } cmd := model.NewDestroyCommandForTest(s.api, refresh, s.store, s.sleep) _, err := testing.RunCommand(c, cmd, "foo") c.Check(called, jc.IsTrue) c.Check(err, gc.ErrorMatches, `cannot read model info: model test1:admin/foo not found`) }
func (s *DestroySuite) NewDestroyCommand() cmd.Command { return model.NewDestroyCommandForTest(s.api) }
func (s *DestroySuite) runDestroyCommand(c *gc.C, args ...string) (*cmd.Context, error) { cmd := model.NewDestroyCommandForTest(s.api) return testing.RunCommand(c, cmd, args...) }
func (s *DestroySuite) NewDestroyCommand() cmd.Command { return model.NewDestroyCommandForTest(s.api, noOpRefresh, s.store, s.sleep) }