Left: | ||
Right: |
LEFT | RIGHT |
---|---|
1 package jujutest | 1 package jujutest |
2 | 2 |
3 import ( | 3 import ( |
4 . "launchpad.net/gocheck" | 4 . "launchpad.net/gocheck" |
5 "launchpad.net/juju/go/juju" | 5 "launchpad.net/juju/go/juju" |
6 ) | 6 ) |
7 | 7 |
8 func (t *Tests) TestStartStop(c *C) { | 8 func (t *Tests) TestStartStop(c *C) { |
9 e, err := t.Environs.Open(t.Name) | 9 e, err := t.Environs.Open(t.Name) |
10 c.Assert(err, IsNil) | 10 c.Assert(err, IsNil) |
11 c.Assert(e, NotNil) | 11 c.Assert(e, NotNil) |
12 | 12 |
13 err = e.Bootstrap() | 13 err = e.Bootstrap() |
14 c.Assert(err, IsNil) | 14 c.Assert(err, IsNil) |
15 | 15 |
16 t.addEnviron(e) | 16 t.addEnviron(e) |
17 | 17 |
18 » ms, err := e.Instances() | 18 » is, err := e.Instances() |
niemeyer
2011/11/30 21:23:26
s/ms/insts/
| |
19 c.Assert(err, IsNil) | 19 c.Assert(err, IsNil) |
20 » c.Assert(len(ms), Equals, 0) | 20 » c.Assert(len(is), Equals, 0) |
21 | 21 |
22 » m, err := e.StartInstance("0") | 22 » m, err := e.StartInstance(0) |
23 c.Assert(err, IsNil) | 23 c.Assert(err, IsNil) |
24 c.Assert(m, NotNil) | 24 c.Assert(m, NotNil) |
25 id0 := m.Id() | 25 id0 := m.Id() |
26 | 26 |
27 » ms, err = e.Instances() | 27 » is, err = e.Instances() |
28 c.Assert(err, IsNil) | 28 c.Assert(err, IsNil) |
29 » c.Assert(len(ms), Equals, 1) | 29 » c.Assert(len(is), Equals, 1) |
30 c.Assert(m.Id(), Equals, id0) | 30 c.Assert(m.Id(), Equals, id0) |
31 | 31 |
32 err = e.StopInstances([]juju.Instance{m}) | 32 err = e.StopInstances([]juju.Instance{m}) |
33 c.Assert(err, IsNil) | 33 c.Assert(err, IsNil) |
niemeyer
2011/11/30 21:23:26
In the end, what is this testing? Many of these me
rog
2011/12/01 08:05:30
it was the first rudimentary test i could think of
| |
34 } | 34 } |
LEFT | RIGHT |