Left: | ||
Right: |
OLD | NEW |
---|---|
1 package ec2 | 1 package ec2 |
2 | 2 |
3 import ( | 3 import ( |
4 "fmt" | 4 "fmt" |
5 "io" | 5 "io" |
6 . "launchpad.net/gocheck" | 6 . "launchpad.net/gocheck" |
7 "net/http" | 7 "net/http" |
8 "os" | 8 "os" |
9 "path/filepath" | 9 "path/filepath" |
10 "testing" | 10 "testing" |
11 ) | 11 ) |
12 | 12 |
13 type imageSuite struct{} | 13 type imageSuite struct{} |
14 | 14 |
15 var _ = Suite(imageSuite{}) | 15 var _ = Suite(imageSuite{}) |
16 | 16 |
17 var oldDefaultConstraint = defaultInstanceConstraint | |
niemeyer
2012/05/25 02:29:56
New variable isn't used in this file?
rog
2012/05/25 07:28:47
Done.
| |
18 | |
17 func (imageSuite) SetUpSuite(c *C) { | 19 func (imageSuite) SetUpSuite(c *C) { |
18 UseTestImageData(true) | 20 UseTestImageData(true) |
19 } | 21 } |
20 | 22 |
21 func (imageSuite) TearDownSuite(c *C) { | 23 func (imageSuite) TearDownSuite(c *C) { |
22 UseTestImageData(false) | 24 UseTestImageData(false) |
23 } | 25 } |
24 | 26 |
25 // N.B. the image IDs in this test will need updating | 27 // N.B. the image IDs in this test will need updating |
26 // if the image directory is regenerated. | 28 // if the image directory is regenerated. |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
133 if err != nil { | 135 if err != nil { |
134 return err | 136 return err |
135 } | 137 } |
136 defer file.Close() | 138 defer file.Close() |
137 _, err = io.Copy(file, r.Body) | 139 _, err = io.Copy(file, r.Body) |
138 if err != nil { | 140 if err != nil { |
139 return fmt.Errorf("error copying image file: %v", err) | 141 return fmt.Errorf("error copying image file: %v", err) |
140 } | 142 } |
141 return nil | 143 return nil |
142 } | 144 } |
OLD | NEW |