Index: cmd/jujuc/server/juju-log_test.go |
=== modified file 'cmd/jujuc/server/juju-log_test.go' |
--- cmd/jujuc/server/juju-log_test.go 2012-08-01 15:48:38 +0000 |
+++ cmd/jujuc/server/juju-log_test.go 2012-10-03 05:55:23 +0000 |
@@ -85,3 +85,17 @@ |
err = com.Init(dummyFlagSet(), nil) |
c.Assert(err, ErrorMatches, "no message specified") |
} |
+ |
+func (s *JujuLogSuite) TestLogLevel(c *C) { |
+ ctx := &server.HookContext{} |
+ com, err := ctx.NewCommand("juju-log") |
+ c.Assert(err, IsNil) |
+ // missing log level argument |
+ err = com.Init(dummyFlagSet(), []string{"-l"}) |
+ c.Assert(err, ErrorMatches, "flag needs an argument.*") |
+ com, err = ctx.NewCommand("juju-log") |
+ c.Assert(err, IsNil) |
+ // valid log level |
+ err = com.Init(dummyFlagSet(), []string{"-l", "FATAL"}) |
+ c.Assert(err, ErrorMatches, "no message specified") |
+} |