Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(2276)

Side by Side Diff: cmd/juju/synctools_test.go

Issue 11561044: Make agent/tools and remove state.Tools
Patch Set: Created 10 years, 8 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2013 Canonical Ltd. 1 // Copyright 2013 Canonical Ltd.
2 // Licensed under the AGPLv3, see LICENCE file for details. 2 // Licensed under the AGPLv3, see LICENCE file for details.
3 3
4 package main 4 package main
5 5
6 import ( 6 import (
7 "io/ioutil" 7 "io/ioutil"
8 "os" 8 "os"
9 "path/filepath" 9 "path/filepath"
10 10
11 . "launchpad.net/gocheck" 11 . "launchpad.net/gocheck"
12 "launchpad.net/juju-core/agent/tools"
12 "launchpad.net/juju-core/cmd" 13 "launchpad.net/juju-core/cmd"
13 "launchpad.net/juju-core/environs" 14 "launchpad.net/juju-core/environs"
14 "launchpad.net/juju-core/environs/dummy" 15 "launchpad.net/juju-core/environs/dummy"
15 envtesting "launchpad.net/juju-core/environs/testing" 16 envtesting "launchpad.net/juju-core/environs/testing"
16 "launchpad.net/juju-core/environs/tools"
17 "launchpad.net/juju-core/testing" 17 "launchpad.net/juju-core/testing"
18 "launchpad.net/juju-core/version" 18 "launchpad.net/juju-core/version"
19 ) 19 )
20 20
21 type syncToolsSuite struct { 21 type syncToolsSuite struct {
22 testing.LoggingSuite 22 testing.LoggingSuite
23 home *testing.FakeHome 23 home *testing.FakeHome
24 targetEnv environs.Environ 24 targetEnv environs.Environ
25 origVersion version.Binary 25 origVersion version.Binary
26 origLocation string 26 origLocation string
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 func putBinary(c *C, storagePath string, v version.Binary) { 210 func putBinary(c *C, storagePath string, v version.Binary) {
211 data := v.String() 211 data := v.String()
212 name := tools.StorageName(v) 212 name := tools.StorageName(v)
213 filename := filepath.Join(storagePath, name) 213 filename := filepath.Join(storagePath, name)
214 dir := filepath.Dir(filename) 214 dir := filepath.Dir(filename)
215 err := os.MkdirAll(dir, 0755) 215 err := os.MkdirAll(dir, 0755)
216 c.Assert(err, IsNil) 216 c.Assert(err, IsNil)
217 err = ioutil.WriteFile(filename, []byte(data), 0666) 217 err = ioutil.WriteFile(filename, []byte(data), 0666)
218 c.Assert(err, IsNil) 218 c.Assert(err, IsNil)
219 } 219 }
OLDNEW

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b