~ubuntu-branches/ubuntu/trusty/juju-core/trusty-proposed

« back to all changes in this revision

Viewing changes to src/launchpad.net/juju-core/cmd/logging_test.go

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2014-01-29 11:40:20 UTC
  • mfrom: (23.1.1 trusty-proposed)
  • Revision ID: package-import@ubuntu.com-20140129114020-ejieitm8smtt5vln
Tags: 1.17.1-0ubuntu2
d/tests/local-provider: Don't fail tests if ~/.juju is present as its
created by the juju version command. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
var _ = gc.Suite(&LogSuite{})
26
26
 
27
27
func (s *LogSuite) SetUpTest(c *gc.C) {
28
 
        s.PatchEnvironment(osenv.JujuLoggingConfig, "")
 
28
        s.PatchEnvironment(osenv.JujuLoggingConfigEnvKey, "")
29
29
        s.AddCleanup(func(_ *gc.C) {
30
30
                loggo.ResetLoggers()
31
31
                loggo.ResetWriters()
51
51
 
52
52
func (s *LogSuite) TestFlags(c *gc.C) {
53
53
        log := newLogWithFlags(c, []string{"--log-file", "foo", "--verbose", "--debug",
54
 
                "--log-config=juju.cmd=INFO;juju.worker.deployer=DEBUG"})
 
54
                "--logging-config=juju.cmd=INFO;juju.worker.deployer=DEBUG"})
55
55
        c.Assert(log.Path, gc.Equals, "foo")
56
56
        c.Assert(log.Verbose, gc.Equals, true)
57
57
        c.Assert(log.Debug, gc.Equals, true)
60
60
 
61
61
func (s *LogSuite) TestLogConfigFromEnvironment(c *gc.C) {
62
62
        config := "juju.cmd=INFO;juju.worker.deployer=DEBUG"
63
 
        testbase.PatchEnvironment(osenv.JujuLoggingConfig, config)
 
63
        testbase.PatchEnvironment(osenv.JujuLoggingConfigEnvKey, config)
64
64
        log := newLogWithFlags(c, []string{})
65
65
        c.Assert(log.Path, gc.Equals, "")
66
66
        c.Assert(log.Verbose, gc.Equals, false)