func (s *MigrateSuite) TestModelDoesntExistBeforeRefresh(c *gc.C) { cmd := s.makeCommand() cmd.SetModelApi(&fakeModelAPI{model: "wat"}) // Model is available after refresh _, err := s.run(c, cmd, "wat", "target") c.Check(err, jc.ErrorIsNil) c.Check(s.api.specSeen, gc.NotNil) }
func (s *MigrateSuite) TestModelDoesntExist(c *gc.C) { cmd := s.makeCommand() cmd.SetModelApi(&fakeModelAPI{}) _, err := s.run(c, cmd, "wat", "target") c.Check(err, gc.ErrorMatches, "model .+ not found") c.Check(s.api.specSeen, gc.IsNil) // API shouldn't have been called }