Пример #1
0
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)
}
Пример #2
0
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
}