Esempio n. 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")
}
Esempio n. 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.*")
}
Esempio n. 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)
		}
	}
}
Esempio n. 4
0
func (s *JujuLogSuite) TestRequiresMessage(c *C) {
	com := newJujuLogCommand(c)
	testing.TestInit(c, com, nil, "no message specified")
}
Esempio n. 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"\]`)
}