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