Left: | ||
Right: |
LEFT | RIGHT |
---|---|
1 package main_test | 1 package main_test |
2 | 2 |
3 import ( | 3 import ( |
4 "io/ioutil" | 4 "io/ioutil" |
5 "launchpad.net/gnuflag" | 5 "launchpad.net/gnuflag" |
6 . "launchpad.net/gocheck" | 6 . "launchpad.net/gocheck" |
7 "launchpad.net/juju/go/cmd" | 7 "launchpad.net/juju/go/cmd" |
8 main "launchpad.net/juju/go/cmd/juju" | 8 main "launchpad.net/juju/go/cmd/juju" |
9 "launchpad.net/juju/go/environs" | 9 "launchpad.net/juju/go/environs" |
10 "launchpad.net/juju/go/environs/dummy" | 10 "launchpad.net/juju/go/environs/dummy" |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
129 return | 129 return |
130 } | 130 } |
131 | 131 |
132 err = com.Run(cmd.DefaultContext()) | 132 err = com.Run(cmd.DefaultContext()) |
133 errc <- err | 133 errc <- err |
134 }() | 134 }() |
135 return | 135 return |
136 } | 136 } |
137 | 137 |
138 func (*cmdSuite) TestBootstrapCommand(c *C) { | 138 func (*cmdSuite) TestBootstrapCommand(c *C) { |
139 defer dummy.Reset() | |
niemeyer
2012/05/21 21:29:10
Why is this necessary, considering that TearDownTe
rog
2012/05/22 09:00:58
Done.
| |
140 | |
141 // normal bootstrap | 139 // normal bootstrap |
142 opc, errc := runCommand(new(main.BootstrapCommand)) | 140 opc, errc := runCommand(new(main.BootstrapCommand)) |
143 c.Check(<-opc, Equals, op(dummy.OpBootstrap, "peckham")) | 141 c.Check(<-opc, Equals, op(dummy.OpBootstrap, "peckham")) |
144 c.Check(<-errc, IsNil) | 142 c.Check(<-errc, IsNil) |
145 | 143 |
146 // bootstrap with tool uploading - checking that a file | 144 // bootstrap with tool uploading - checking that a file |
147 // is uploaded should be sufficient, as the detailed semantics | 145 // is uploaded should be sufficient, as the detailed semantics |
148 // of UploadTools are tested in environs. | 146 // of UploadTools are tested in environs. |
149 opc, errc = runCommand(new(main.BootstrapCommand), "--upload-tools") | 147 opc, errc = runCommand(new(main.BootstrapCommand), "--upload-tools") |
150 c.Check(<-opc, Equals, op(dummy.OpPutFile, "peckham")) | 148 c.Check(<-opc, Equals, op(dummy.OpPutFile, "peckham")) |
(...skipping 25 matching lines...) Expand all Loading... | |
176 c.Check((<-opc).Kind, Equals, dummy.OpNone) | 174 c.Check((<-opc).Kind, Equals, dummy.OpNone) |
177 c.Check(<-errc, ErrorMatches, `broken environment`) | 175 c.Check(<-errc, ErrorMatches, `broken environment`) |
178 } | 176 } |
179 | 177 |
180 func op(kind dummy.OperationKind, name string) dummy.Operation { | 178 func op(kind dummy.OperationKind, name string) dummy.Operation { |
181 return dummy.Operation{ | 179 return dummy.Operation{ |
182 Env: name, | 180 Env: name, |
183 Kind: kind, | 181 Kind: kind, |
184 } | 182 } |
185 } | 183 } |
LEFT | RIGHT |