~dave-cheney/juju-core/044-environs-respect-default-series

« back to all changes in this revision

Viewing changes to cmd/juju/cmd_test.go

  • Committer: Dave Cheney
  • Date: 2012-11-30 01:35:02 UTC
  • mfrom: (713.2.47 juju-core)
  • Revision ID: david.cheney@canonical.com-20121130013502-x6megsp5pf55rf0a
mergeĀ fromĀ trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
package main
2
2
 
3
3
import (
 
4
        "io/ioutil"
4
5
        "os"
5
6
        "reflect"
6
7
 
13
14
 
14
15
type CmdSuite struct {
15
16
        testing.JujuConnSuite
 
17
        home fakeHome
16
18
}
17
19
 
18
20
var _ = Suite(&CmdSuite{})
24
26
    peckham:
25
27
        type: dummy
26
28
        state-server: false
 
29
        admin-secret: arble
27
30
        authorized-keys: i-am-a-key
28
31
    walthamstow:
29
32
        type: dummy
38
41
 
39
42
func (s *CmdSuite) SetUpTest(c *C) {
40
43
        s.JujuConnSuite.SetUpTest(c)
41
 
        s.JujuConnSuite.WriteConfig(envConfig)
 
44
        s.home = makeFakeHome(c, "peckham", "walthamstow", "brokenenv")
 
45
        err := ioutil.WriteFile(homePath(".juju", "environments.yaml"), []byte(envConfig), 0666)
 
46
        c.Assert(err, IsNil)
 
47
}
 
48
 
 
49
func (s *CmdSuite) TearDownTest(c *C) {
 
50
        s.home.restore()
 
51
        s.JujuConnSuite.TearDownTest(c)
42
52
}
43
53
 
44
54
func newFlagSet() *gnuflag.FlagSet {