~mfoord/juju-core/tests-replset

« back to all changes in this revision

Viewing changes to cmd/juju/bootstrap_test.go

  • Committer: Benji York
  • Date: 2013-03-20 20:05:34 UTC
  • mfrom: (1010.3.15 1130172)
  • Revision ID: benji.york@canonical.com-20130320200534-ho97u66shmicxkkf
Add SetServiceConstraints to API

This also involved moving the Constraints struct into its own package in order
to break an import cycle.

R=dfc, bac, dimitern, fwereade
CC=
https://codereview.appspot.com/7600044

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
        "bytes"
5
5
        . "launchpad.net/gocheck"
6
6
        "launchpad.net/juju-core/cmd"
 
7
        "launchpad.net/juju-core/constraints"
7
8
        "launchpad.net/juju-core/environs"
8
9
        "launchpad.net/juju-core/environs/agent"
9
10
        "launchpad.net/juju-core/environs/dummy"
10
 
        "launchpad.net/juju-core/state"
11
11
        "launchpad.net/juju-core/testing"
12
12
        "launchpad.net/juju-core/version"
13
13
        "net/http"
49
49
        c.Check(<-errc, IsNil)
50
50
        opBootstrap := (<-opc).(dummy.OpBootstrap)
51
51
        c.Check(opBootstrap.Env, Equals, "peckham")
52
 
        c.Check(opBootstrap.Constraints, DeepEquals, state.Constraints{})
 
52
        c.Check(opBootstrap.Constraints, DeepEquals, constraints.Value{})
53
53
}
54
54
 
55
55
func (*BootstrapSuite) TestRunGeneratesCertificate(c *C) {
75
75
func (*BootstrapSuite) TestConstraints(c *C) {
76
76
        defer testing.MakeFakeHome(c, envConfig, "brokenenv").Restore()
77
77
        scons := " cpu-cores=2   mem=4G"
78
 
        cons, err := state.ParseConstraints(scons)
 
78
        cons, err := constraints.Parse(scons)
79
79
        c.Assert(err, IsNil)
80
80
        opc, errc := runCommand(new(BootstrapCommand), "--constraints", scons)
81
81
        c.Check(<-errc, IsNil)
94
94
        c.Check((<-opc).(dummy.OpPutFile).Env, Equals, "peckham")
95
95
        opBootstrap := (<-opc).(dummy.OpBootstrap)
96
96
        c.Check(opBootstrap.Env, Equals, "peckham")
97
 
        c.Check(opBootstrap.Constraints, DeepEquals, state.Constraints{})
 
97
        c.Check(opBootstrap.Constraints, DeepEquals, constraints.Value{})
98
98
 
99
99
        // Check that some file was uploaded and can be unpacked; detailed
100
100
        // semantics tested elsewhere.