func (s *ConstraintsCommandsSuite) assertSetError(c *gc.C, code int, stderr string, args ...string) { command := cmdcommon.NewSetConstraintsCommandWithAPI(s.fake) rcode, rstdout, rstderr := runCmdLine(c, command, args...) c.Assert(rcode, gc.Equals, code) c.Assert(rstdout, gc.Equals, "") c.Assert(rstderr, gc.Matches, "error: "+stderr+"\n") }
func (s *ConstraintsCommandsSuite) assertSet(c *gc.C, args ...string) { command := cmdcommon.NewSetConstraintsCommandWithAPI(s.fake) rcode, rstdout, rstderr := runCmdLine(c, command, args...) c.Assert(rcode, gc.Equals, 0) c.Assert(rstdout, gc.Equals, "") c.Assert(rstderr, gc.Equals, "") }
func (s *ConstraintsCommandsSuite) assertSetBlocked(c *gc.C, args ...string) { command := cmdcommon.NewSetConstraintsCommandWithAPI(s.fake) rcode, _, _ := runCmdLine(c, command, args...) c.Assert(rcode, gc.Equals, 1) // msg is logged stripped := strings.Replace(c.GetTestLog(), "\n", "", -1) c.Check(stripped, gc.Matches, ".*To unblock changes.*") }