示例#1
0
func (s *JujuLogSuite) TestLogInitMissingMessage(c *C) {
	com := newJujuLogCommand(c)
	testing.TestInit(c, com, []string{"-l", "FATAL"}, "no message specified")

	com = newJujuLogCommand(c)
	testing.TestInit(c, com, []string{"--log-level", "FATAL"}, "no message specified")
}
示例#2
0
func (s *JujuLogSuite) TestLogInitMissingLevel(c *C) {
	com := newJujuLogCommand(c)
	testing.TestInit(c, com, []string{"-l"}, "flag needs an argument.*")

	com = newJujuLogCommand(c)
	testing.TestInit(c, com, []string{"--log-level"}, "flag needs an argument.*")
}
示例#3
0
func (s *SetEnvironmentSuite) TestInit(c *C) {

	for _, t := range setEnvInitTests {
		command := &SetEnvironmentCommand{}
		testing.TestInit(c, command, t.args, t.err)
		if t.expected != nil {
			c.Assert(command.values, DeepEquals, t.expected)
		}
	}
}
示例#4
0
func (s *JujuLogSuite) TestRequiresMessage(c *C) {
	com := newJujuLogCommand(c)
	testing.TestInit(c, com, nil, "no message specified")
}
示例#5
0
func (s *ConfigGetSuite) TestUnknownArg(c *C) {
	hctx := s.GetHookContext(c, -1, "")
	com, err := jujuc.NewCommand(hctx, "config-get")
	c.Assert(err, IsNil)
	testing.TestInit(c, com, []string{"multiple", "keys"}, `unrecognized args: \["keys"\]`)
}