OLD | NEW |
1 package environs_test | 1 package environs_test |
2 | 2 |
3 import ( | 3 import ( |
4 "bytes" | 4 "bytes" |
5 "fmt" | 5 "fmt" |
6 "io/ioutil" | 6 "io/ioutil" |
7 . "launchpad.net/gocheck" | 7 . "launchpad.net/gocheck" |
8 "launchpad.net/juju-core/environs" | 8 "launchpad.net/juju-core/environs" |
9 "launchpad.net/juju-core/environs/dummy" | 9 "launchpad.net/juju-core/environs/dummy" |
10 "launchpad.net/juju-core/state" | 10 "launchpad.net/juju-core/state" |
11 "launchpad.net/juju-core/testing" | 11 "launchpad.net/juju-core/testing" |
12 "launchpad.net/juju-core/version" | 12 "launchpad.net/juju-core/version" |
13 "net/http" | 13 "net/http" |
14 "os" | 14 "os" |
15 "os/exec" | 15 "os/exec" |
16 "path/filepath" | 16 "path/filepath" |
17 "sort" | 17 "sort" |
18 "strings" | 18 "strings" |
19 ) | 19 ) |
20 | 20 |
21 type ToolsSuite struct { | 21 type ToolsSuite struct { |
22 env environs.Environ | 22 env environs.Environ |
23 testing.LoggingSuite | 23 testing.LoggingSuite |
24 » oldVarDir string | 24 » dataDir string |
25 } | 25 } |
26 | 26 |
27 func (t *ToolsSuite) SetUpTest(c *C) { | 27 func (t *ToolsSuite) SetUpTest(c *C) { |
28 t.LoggingSuite.SetUpTest(c) | 28 t.LoggingSuite.SetUpTest(c) |
29 env, err := environs.NewFromAttrs(map[string]interface{}{ | 29 env, err := environs.NewFromAttrs(map[string]interface{}{ |
30 "name": "test", | 30 "name": "test", |
31 "type": "dummy", | 31 "type": "dummy", |
32 "zookeeper": false, | 32 "zookeeper": false, |
33 "authorized-keys": "i-am-a-key", | 33 "authorized-keys": "i-am-a-key", |
34 }) | 34 }) |
35 c.Assert(err, IsNil) | 35 c.Assert(err, IsNil) |
36 t.env = env | 36 t.env = env |
37 » t.oldVarDir = environs.VarDir | 37 » t.dataDir = c.MkDir() |
38 » environs.VarDir = c.MkDir() | |
39 } | 38 } |
40 | 39 |
41 func (t *ToolsSuite) TearDownTest(c *C) { | 40 func (t *ToolsSuite) TearDownTest(c *C) { |
42 environs.VarDir = t.oldVarDir | |
43 dummy.Reset() | 41 dummy.Reset() |
44 t.LoggingSuite.TearDownTest(c) | 42 t.LoggingSuite.TearDownTest(c) |
45 } | 43 } |
46 | 44 |
47 var envs *environs.Environs | 45 var envs *environs.Environs |
48 | 46 |
49 func toolsStoragePath(vers string) string { | 47 func toolsStoragePath(vers string) string { |
50 return environs.ToolsStoragePath(version.Binary{ | 48 return environs.ToolsStoragePath(version.Binary{ |
51 Number: version.MustParse(vers), | 49 Number: version.MustParse(vers), |
52 Series: version.Current.Series, | 50 Series: version.Current.Series, |
(...skipping 20 matching lines...) Expand all Loading... |
73 "(.|\n)*error: jujuc should not be called directly\n", | 71 "(.|\n)*error: jujuc should not be called directly\n", |
74 }, | 72 }, |
75 } | 73 } |
76 | 74 |
77 func (t *ToolsSuite) TestPutGetTools(c *C) { | 75 func (t *ToolsSuite) TestPutGetTools(c *C) { |
78 tools, err := environs.PutTools(t.env.Storage(), nil) | 76 tools, err := environs.PutTools(t.env.Storage(), nil) |
79 c.Assert(err, IsNil) | 77 c.Assert(err, IsNil) |
80 c.Assert(tools.Binary, Equals, version.Current) | 78 c.Assert(tools.Binary, Equals, version.Current) |
81 c.Assert(tools.URL, Not(Equals), "") | 79 c.Assert(tools.URL, Not(Equals), "") |
82 | 80 |
83 » for i, get := range []func(t *state.Tools) error{ | 81 » for i, get := range []func(dataDir string, t *state.Tools) error{ |
84 getTools, | 82 getTools, |
85 getToolsWithTar, | 83 getToolsWithTar, |
86 } { | 84 } { |
87 c.Logf("test %d", i) | 85 c.Logf("test %d", i) |
88 // Unarchive the tool executables into a temp directory. | 86 // Unarchive the tool executables into a temp directory. |
89 » » environs.VarDir = c.MkDir() | 87 » » dataDir := c.MkDir() |
90 » » err = get(tools) | 88 » » err = get(dataDir, tools) |
91 c.Assert(err, IsNil) | 89 c.Assert(err, IsNil) |
92 | 90 |
93 » » dir := environs.ToolsDir(version.Current) | 91 » » dir := environs.ToolsDir(dataDir, version.Current) |
94 // Verify that each tool executes and produces some | 92 // Verify that each tool executes and produces some |
95 // characteristic output. | 93 // characteristic output. |
96 for i, test := range commandTests { | 94 for i, test := range commandTests { |
97 c.Logf("command test %d", i) | 95 c.Logf("command test %d", i) |
98 out, err := exec.Command(filepath.Join(dir, test.cmd[0])
, test.cmd[1:]...).CombinedOutput() | 96 out, err := exec.Command(filepath.Join(dir, test.cmd[0])
, test.cmd[1:]...).CombinedOutput() |
99 if err != nil { | 97 if err != nil { |
100 c.Assert(err, FitsTypeOf, (*exec.ExitError)(nil)
) | 98 c.Assert(err, FitsTypeOf, (*exec.ExitError)(nil)
) |
101 } | 99 } |
102 c.Check(string(out), Matches, test.output) | 100 c.Check(string(out), Matches, test.output) |
103 } | 101 } |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 }, | 160 }, |
163 } | 161 } |
164 | 162 |
165 func (t *ToolsSuite) TestUnpackToolsBadData(c *C) { | 163 func (t *ToolsSuite) TestUnpackToolsBadData(c *C) { |
166 for i, test := range unpackToolsBadDataTests { | 164 for i, test := range unpackToolsBadDataTests { |
167 c.Logf("test %d", i) | 165 c.Logf("test %d", i) |
168 tools := &state.Tools{ | 166 tools := &state.Tools{ |
169 URL: "http://foo/bar", | 167 URL: "http://foo/bar", |
170 Binary: version.MustParseBinary("1.2.3-foo-bar"), | 168 Binary: version.MustParseBinary("1.2.3-foo-bar"), |
171 } | 169 } |
172 » » err := environs.UnpackTools(tools, bytes.NewReader(test.data)) | 170 » » err := environs.UnpackTools(t.dataDir, tools, bytes.NewReader(te
st.data)) |
173 c.Assert(err, ErrorMatches, test.err) | 171 c.Assert(err, ErrorMatches, test.err) |
174 » » assertDirNames(c, toolsDir(), []string{}) | 172 » » assertDirNames(c, t.toolsDir(), []string{}) |
175 } | 173 } |
176 } | 174 } |
177 | 175 |
178 func toolsDir() string { | 176 func (t *ToolsSuite) toolsDir() string { |
179 » return filepath.Join(environs.VarDir, "tools") | 177 » return filepath.Join(t.dataDir, "tools") |
180 } | 178 } |
181 | 179 |
182 func (t *ToolsSuite) TestUnpackToolsContents(c *C) { | 180 func (t *ToolsSuite) TestUnpackToolsContents(c *C) { |
183 files := []*testing.TarFile{ | 181 files := []*testing.TarFile{ |
184 testing.NewTarFile("bar", 0755, "bar contents"), | 182 testing.NewTarFile("bar", 0755, "bar contents"), |
185 testing.NewTarFile("foo", 0755, "foo contents"), | 183 testing.NewTarFile("foo", 0755, "foo contents"), |
186 } | 184 } |
187 tools := &state.Tools{ | 185 tools := &state.Tools{ |
188 URL: "http://foo/bar", | 186 URL: "http://foo/bar", |
189 Binary: version.MustParseBinary("1.2.3-foo-bar"), | 187 Binary: version.MustParseBinary("1.2.3-foo-bar"), |
190 } | 188 } |
191 | 189 |
192 » err := environs.UnpackTools(tools, bytes.NewReader(testing.TarGz(files..
.))) | 190 » err := environs.UnpackTools(t.dataDir, tools, bytes.NewReader(testing.Ta
rGz(files...))) |
193 c.Assert(err, IsNil) | 191 c.Assert(err, IsNil) |
194 » assertDirNames(c, toolsDir(), []string{"1.2.3-foo-bar"}) | 192 » assertDirNames(c, t.toolsDir(), []string{"1.2.3-foo-bar"}) |
195 » assertToolsContents(c, tools, files) | 193 » t.assertToolsContents(c, tools, files) |
196 | 194 |
197 // Try to unpack the same version of tools again - it should succeed, | 195 // Try to unpack the same version of tools again - it should succeed, |
198 // leaving the original version around. | 196 // leaving the original version around. |
199 tools2 := &state.Tools{ | 197 tools2 := &state.Tools{ |
200 URL: "http://arble", | 198 URL: "http://arble", |
201 Binary: version.MustParseBinary("1.2.3-foo-bar"), | 199 Binary: version.MustParseBinary("1.2.3-foo-bar"), |
202 } | 200 } |
203 files2 := []*testing.TarFile{ | 201 files2 := []*testing.TarFile{ |
204 testing.NewTarFile("bar", 0755, "bar2 contents"), | 202 testing.NewTarFile("bar", 0755, "bar2 contents"), |
205 testing.NewTarFile("x", 0755, "x contents"), | 203 testing.NewTarFile("x", 0755, "x contents"), |
206 } | 204 } |
207 » err = environs.UnpackTools(tools2, bytes.NewReader(testing.TarGz(files2.
..))) | 205 » err = environs.UnpackTools(t.dataDir, tools2, bytes.NewReader(testing.Ta
rGz(files2...))) |
208 c.Assert(err, IsNil) | 206 c.Assert(err, IsNil) |
209 » assertDirNames(c, toolsDir(), []string{"1.2.3-foo-bar"}) | 207 » assertDirNames(c, t.toolsDir(), []string{"1.2.3-foo-bar"}) |
210 » assertToolsContents(c, tools, files) | 208 » t.assertToolsContents(c, tools, files) |
211 } | 209 } |
212 | 210 |
213 func (t *ToolsSuite) TestReadToolsErrors(c *C) { | 211 func (t *ToolsSuite) TestReadToolsErrors(c *C) { |
214 vers := version.MustParseBinary("1.2.3-precise-amd64") | 212 vers := version.MustParseBinary("1.2.3-precise-amd64") |
215 » tools, err := environs.ReadTools(vers) | 213 » tools, err := environs.ReadTools(t.dataDir, vers) |
216 c.Assert(tools, IsNil) | 214 c.Assert(tools, IsNil) |
217 c.Assert(err, ErrorMatches, "cannot read URL in tools directory: .*") | 215 c.Assert(err, ErrorMatches, "cannot read URL in tools directory: .*") |
218 | 216 |
219 » dir := environs.ToolsDir(vers) | 217 » dir := environs.ToolsDir(t.dataDir, vers) |
220 err = os.MkdirAll(dir, 0755) | 218 err = os.MkdirAll(dir, 0755) |
221 c.Assert(err, IsNil) | 219 c.Assert(err, IsNil) |
222 | 220 |
223 err = ioutil.WriteFile(filepath.Join(dir, urlFile), []byte(" \t\n"), 064
4) | 221 err = ioutil.WriteFile(filepath.Join(dir, urlFile), []byte(" \t\n"), 064
4) |
224 c.Assert(err, IsNil) | 222 c.Assert(err, IsNil) |
225 | 223 |
226 » tools, err = environs.ReadTools(vers) | 224 » tools, err = environs.ReadTools(t.dataDir, vers) |
227 c.Assert(tools, IsNil) | 225 c.Assert(tools, IsNil) |
228 c.Assert(err, ErrorMatches, "empty URL in tools directory.*") | 226 c.Assert(err, ErrorMatches, "empty URL in tools directory.*") |
229 } | 227 } |
230 | 228 |
231 func (t *ToolsSuite) TestToolsStoragePath(c *C) { | 229 func (t *ToolsSuite) TestToolsStoragePath(c *C) { |
232 c.Assert(environs.ToolsStoragePath(binaryVersion("1.2.3-precise-amd64"))
, | 230 c.Assert(environs.ToolsStoragePath(binaryVersion("1.2.3-precise-amd64"))
, |
233 Equals, "tools/juju-1.2.3-precise-amd64.tgz") | 231 Equals, "tools/juju-1.2.3-precise-amd64.tgz") |
234 } | 232 } |
235 | 233 |
236 func (t *ToolsSuite) TestToolsDir(c *C) { | 234 func (t *ToolsSuite) TestToolsDir(c *C) { |
237 » environs.VarDir = "/var/lib/juju" | 235 » c.Assert(environs.ToolsDir("/var/lib/juju", binaryVersion("1.2.3-precise
-amd64")), |
238 » c.Assert(environs.ToolsDir(binaryVersion("1.2.3-precise-amd64")), | |
239 Equals, | 236 Equals, |
240 "/var/lib/juju/tools/1.2.3-precise-amd64") | 237 "/var/lib/juju/tools/1.2.3-precise-amd64") |
241 } | 238 } |
242 | 239 |
243 // getTools downloads and unpacks the given tools. | 240 // getTools downloads and unpacks the given tools. |
244 func getTools(tools *state.Tools) error { | 241 func getTools(dataDir string, tools *state.Tools) error { |
245 resp, err := http.Get(tools.URL) | 242 resp, err := http.Get(tools.URL) |
246 if err != nil { | 243 if err != nil { |
247 return err | 244 return err |
248 } | 245 } |
249 defer resp.Body.Close() | 246 defer resp.Body.Close() |
250 if resp.StatusCode != http.StatusOK { | 247 if resp.StatusCode != http.StatusOK { |
251 return fmt.Errorf("bad http status: %v", resp.Status) | 248 return fmt.Errorf("bad http status: %v", resp.Status) |
252 } | 249 } |
253 » return environs.UnpackTools(tools, resp.Body) | 250 » return environs.UnpackTools(dataDir, tools, resp.Body) |
254 } | 251 } |
255 | 252 |
256 // getToolsWithTar is the same as getTools but uses tar | 253 // getToolsWithTar is the same as getTools but uses tar |
257 // itself so we're not just testing the Go tar package against | 254 // itself so we're not just testing the Go tar package against |
258 // itself. | 255 // itself. |
259 func getToolsWithTar(tools *state.Tools) error { | 256 func getToolsWithTar(dataDir string, tools *state.Tools) error { |
260 resp, err := http.Get(tools.URL) | 257 resp, err := http.Get(tools.URL) |
261 if err != nil { | 258 if err != nil { |
262 return err | 259 return err |
263 } | 260 } |
264 defer resp.Body.Close() | 261 defer resp.Body.Close() |
265 | 262 |
266 » dir := environs.ToolsDir(tools.Binary) | 263 » dir := environs.ToolsDir(dataDir, tools.Binary) |
267 err = os.MkdirAll(dir, 0755) | 264 err = os.MkdirAll(dir, 0755) |
268 if err != nil { | 265 if err != nil { |
269 return err | 266 return err |
270 } | 267 } |
271 | 268 |
272 cmd := exec.Command("tar", "xz") | 269 cmd := exec.Command("tar", "xz") |
273 cmd.Dir = dir | 270 cmd.Dir = dir |
274 cmd.Stdin = resp.Body | 271 cmd.Stdin = resp.Body |
275 out, err := cmd.CombinedOutput() | 272 out, err := cmd.CombinedOutput() |
276 if err != nil { | 273 if err != nil { |
277 return fmt.Errorf("tar extract failed: %s", out) | 274 return fmt.Errorf("tar extract failed: %s", out) |
278 } | 275 } |
279 return ioutil.WriteFile(filepath.Join(cmd.Dir, urlFile), []byte(tools.UR
L), 0644) | 276 return ioutil.WriteFile(filepath.Join(cmd.Dir, urlFile), []byte(tools.UR
L), 0644) |
280 } | 277 } |
281 | 278 |
282 // assertToolsContents asserts that the directory for the tools | 279 // assertToolsContents asserts that the directory for the tools |
283 // has the given contents. | 280 // has the given contents. |
284 func assertToolsContents(c *C, tools *state.Tools, files []*testing.TarFile) { | 281 func (t *ToolsSuite) assertToolsContents(c *C, tools *state.Tools, files []*test
ing.TarFile) { |
285 var wantNames []string | 282 var wantNames []string |
286 for _, f := range files { | 283 for _, f := range files { |
287 wantNames = append(wantNames, f.Header.Name) | 284 wantNames = append(wantNames, f.Header.Name) |
288 } | 285 } |
289 wantNames = append(wantNames, urlFile) | 286 wantNames = append(wantNames, urlFile) |
290 » dir := environs.ToolsDir(tools.Binary) | 287 » dir := environs.ToolsDir(t.dataDir, tools.Binary) |
291 assertDirNames(c, dir, wantNames) | 288 assertDirNames(c, dir, wantNames) |
292 assertFileContents(c, dir, urlFile, tools.URL, 0200) | 289 assertFileContents(c, dir, urlFile, tools.URL, 0200) |
293 for _, f := range files { | 290 for _, f := range files { |
294 assertFileContents(c, dir, f.Header.Name, f.Contents, 0400) | 291 assertFileContents(c, dir, f.Header.Name, f.Contents, 0400) |
295 } | 292 } |
296 » gotTools, err := environs.ReadTools(tools.Binary) | 293 » gotTools, err := environs.ReadTools(t.dataDir, tools.Binary) |
297 c.Assert(err, IsNil) | 294 c.Assert(err, IsNil) |
298 c.Assert(*gotTools, Equals, *tools) | 295 c.Assert(*gotTools, Equals, *tools) |
299 } | 296 } |
300 | 297 |
301 // assertFileContents asserts that the given file in the | 298 // assertFileContents asserts that the given file in the |
302 // given directory has the given contents. | 299 // given directory has the given contents. |
303 func assertFileContents(c *C, dir, file, contents string, mode os.FileMode) { | 300 func assertFileContents(c *C, dir, file, contents string, mode os.FileMode) { |
304 file = filepath.Join(dir, file) | 301 file = filepath.Join(dir, file) |
305 info, err := os.Stat(file) | 302 info, err := os.Stat(file) |
306 c.Assert(err, IsNil) | 303 c.Assert(err, IsNil) |
(...skipping 18 matching lines...) Expand all Loading... |
325 | 322 |
326 func (t *ToolsSuite) TestChangeAgentTools(c *C) { | 323 func (t *ToolsSuite) TestChangeAgentTools(c *C) { |
327 files := []*testing.TarFile{ | 324 files := []*testing.TarFile{ |
328 testing.NewTarFile("jujuc", 0755, "juju executable"), | 325 testing.NewTarFile("jujuc", 0755, "juju executable"), |
329 testing.NewTarFile("jujud", 0755, "jujuc executable"), | 326 testing.NewTarFile("jujud", 0755, "jujuc executable"), |
330 } | 327 } |
331 tools := &state.Tools{ | 328 tools := &state.Tools{ |
332 URL: "http://foo/bar1", | 329 URL: "http://foo/bar1", |
333 Binary: version.MustParseBinary("1.2.3-foo-bar"), | 330 Binary: version.MustParseBinary("1.2.3-foo-bar"), |
334 } | 331 } |
335 » err := environs.UnpackTools(tools, bytes.NewReader(testing.TarGz(files..
.))) | 332 » err := environs.UnpackTools(t.dataDir, tools, bytes.NewReader(testing.Ta
rGz(files...))) |
336 c.Assert(err, IsNil) | 333 c.Assert(err, IsNil) |
337 | 334 |
338 » gotTools, err := environs.ChangeAgentTools("testagent", tools.Binary) | 335 » gotTools, err := environs.ChangeAgentTools(t.dataDir, "testagent", tools
.Binary) |
339 c.Assert(err, IsNil) | 336 c.Assert(err, IsNil) |
340 c.Assert(*gotTools, Equals, *tools) | 337 c.Assert(*gotTools, Equals, *tools) |
341 | 338 |
342 » assertDirNames(c, toolsDir(), []string{"1.2.3-foo-bar", "testagent"}) | 339 » assertDirNames(c, t.toolsDir(), []string{"1.2.3-foo-bar", "testagent"}) |
343 » assertDirNames(c, environs.AgentToolsDir("testagent"), []string{"jujuc",
"jujud", urlFile}) | 340 » assertDirNames(c, environs.AgentToolsDir(t.dataDir, "testagent"), []stri
ng{"jujuc", "jujud", urlFile}) |
344 | 341 |
345 // Upgrade again to check that the link replacement logic works ok. | 342 // Upgrade again to check that the link replacement logic works ok. |
346 files2 := []*testing.TarFile{ | 343 files2 := []*testing.TarFile{ |
347 testing.NewTarFile("foo", 0755, "foo content"), | 344 testing.NewTarFile("foo", 0755, "foo content"), |
348 testing.NewTarFile("bar", 0755, "bar content"), | 345 testing.NewTarFile("bar", 0755, "bar content"), |
349 } | 346 } |
350 tools2 := &state.Tools{ | 347 tools2 := &state.Tools{ |
351 URL: "http://foo/bar2", | 348 URL: "http://foo/bar2", |
352 Binary: version.MustParseBinary("1.2.4-foo-bar"), | 349 Binary: version.MustParseBinary("1.2.4-foo-bar"), |
353 } | 350 } |
354 » err = environs.UnpackTools(tools2, bytes.NewReader(testing.TarGz(files2.
..))) | 351 » err = environs.UnpackTools(t.dataDir, tools2, bytes.NewReader(testing.Ta
rGz(files2...))) |
355 c.Assert(err, IsNil) | 352 c.Assert(err, IsNil) |
356 | 353 |
357 » gotTools, err = environs.ChangeAgentTools("testagent", tools2.Binary) | 354 » gotTools, err = environs.ChangeAgentTools(t.dataDir, "testagent", tools2
.Binary) |
358 c.Assert(err, IsNil) | 355 c.Assert(err, IsNil) |
359 c.Assert(*gotTools, Equals, *tools2) | 356 c.Assert(*gotTools, Equals, *tools2) |
360 | 357 |
361 » assertDirNames(c, toolsDir(), []string{"1.2.3-foo-bar", "1.2.4-foo-bar",
"testagent"}) | 358 » assertDirNames(c, t.toolsDir(), []string{"1.2.3-foo-bar", "1.2.4-foo-bar
", "testagent"}) |
362 » assertDirNames(c, environs.AgentToolsDir("testagent"), []string{"foo", "
bar", urlFile}) | 359 » assertDirNames(c, environs.AgentToolsDir(t.dataDir, "testagent"), []stri
ng{"foo", "bar", urlFile}) |
363 } | 360 } |
364 | 361 |
365 // gzyesses holds the result of running: | 362 // gzyesses holds the result of running: |
366 // yes | head -17000 | gzip | 363 // yes | head -17000 | gzip |
367 var gzyesses = []byte{ | 364 var gzyesses = []byte{ |
368 0x1f, 0x8b, 0x08, 0x00, 0x29, 0xae, 0x1a, 0x50, | 365 0x1f, 0x8b, 0x08, 0x00, 0x29, 0xae, 0x1a, 0x50, |
369 0x00, 0x03, 0xed, 0xc2, 0x31, 0x0d, 0x00, 0x00, | 366 0x00, 0x03, 0xed, 0xc2, 0x31, 0x0d, 0x00, 0x00, |
370 0x00, 0x02, 0xa0, 0xdf, 0xc6, 0xb6, 0xb7, 0x87, | 367 0x00, 0x02, 0xa0, 0xdf, 0xc6, 0xb6, 0xb7, 0x87, |
371 0x63, 0xd0, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, | 368 0x63, 0xd0, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, |
372 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | 369 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
772 tools := environs.BestTools(t.list, t.vers, environs.CompatVersi
on) | 769 tools := environs.BestTools(t.list, t.vers, environs.CompatVersi
on) |
773 c.Assert(tools, DeepEquals, t.expect) | 770 c.Assert(tools, DeepEquals, t.expect) |
774 tools = environs.BestTools(t.list, t.vers, environs.DevVersion|e
nvirons.CompatVersion) | 771 tools = environs.BestTools(t.list, t.vers, environs.DevVersion|e
nvirons.CompatVersion) |
775 c.Assert(tools, DeepEquals, t.expectDev) | 772 c.Assert(tools, DeepEquals, t.expectDev) |
776 tools = environs.BestTools(t.list, t.vers, environs.HighestVersi
on|environs.CompatVersion) | 773 tools = environs.BestTools(t.list, t.vers, environs.HighestVersi
on|environs.CompatVersion) |
777 c.Assert(tools, DeepEquals, t.expectHighest) | 774 c.Assert(tools, DeepEquals, t.expectHighest) |
778 tools = environs.BestTools(t.list, t.vers, environs.DevVersion|e
nvirons.HighestVersion|environs.CompatVersion) | 775 tools = environs.BestTools(t.list, t.vers, environs.DevVersion|e
nvirons.HighestVersion|environs.CompatVersion) |
779 c.Assert(tools, DeepEquals, t.expectDevHighest) | 776 c.Assert(tools, DeepEquals, t.expectDevHighest) |
780 } | 777 } |
781 } | 778 } |
OLD | NEW |