示例#1
0
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")
}
示例#2
0
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, "")
}
示例#3
0
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.*")
}