예제 #1
0
파일: destroy_test.go 프로젝트: bac/juju
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`)
}
예제 #2
0
func (s *DestroySuite) NewDestroyCommand() cmd.Command {
	return model.NewDestroyCommandForTest(s.api)
}
예제 #3
0
func (s *DestroySuite) runDestroyCommand(c *gc.C, args ...string) (*cmd.Context, error) {
	cmd := model.NewDestroyCommandForTest(s.api)
	return testing.RunCommand(c, cmd, args...)
}
예제 #4
0
파일: destroy_test.go 프로젝트: bac/juju
func (s *DestroySuite) NewDestroyCommand() cmd.Command {
	return model.NewDestroyCommandForTest(s.api, noOpRefresh, s.store, s.sleep)
}