OLD | NEW |
1 // Copyright 2012, 2013 Canonical Ltd. | 1 // Copyright 2012, 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 downloader_test | 4 package downloader_test |
5 | 5 |
6 import ( | 6 import ( |
7 "io/ioutil" | 7 "io/ioutil" |
8 "os" | 8 "os" |
9 "path/filepath" | 9 "path/filepath" |
10 stdtesting "testing" | 10 stdtesting "testing" |
11 "time" | 11 "time" |
12 | 12 |
13 gc "launchpad.net/gocheck" | 13 gc "launchpad.net/gocheck" |
14 | 14 |
15 "launchpad.net/juju-core/downloader" | 15 "launchpad.net/juju-core/downloader" |
16 "launchpad.net/juju-core/testing" | 16 "launchpad.net/juju-core/testing" |
| 17 "launchpad.net/juju-core/testing/testbase" |
17 ) | 18 ) |
18 | 19 |
19 type suite struct { | 20 type suite struct { |
20 » testing.LoggingSuite | 21 » testbase.LoggingSuite |
21 testing.HTTPSuite | 22 testing.HTTPSuite |
22 } | 23 } |
23 | 24 |
24 func (s *suite) SetUpSuite(c *gc.C) { | 25 func (s *suite) SetUpSuite(c *gc.C) { |
25 s.LoggingSuite.SetUpSuite(c) | 26 s.LoggingSuite.SetUpSuite(c) |
26 s.HTTPSuite.SetUpSuite(c) | 27 s.HTTPSuite.SetUpSuite(c) |
27 } | 28 } |
28 | 29 |
29 func (s *suite) TearDownSuite(c *gc.C) { | 30 func (s *suite) TearDownSuite(c *gc.C) { |
30 s.HTTPSuite.TearDownSuite(c) | 31 s.HTTPSuite.TearDownSuite(c) |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 | 87 |
87 func assertFileContents(c *gc.C, f *os.File, expect string) { | 88 func assertFileContents(c *gc.C, f *os.File, expect string) { |
88 got, err := ioutil.ReadAll(f) | 89 got, err := ioutil.ReadAll(f) |
89 c.Assert(err, gc.IsNil) | 90 c.Assert(err, gc.IsNil) |
90 if !c.Check(string(got), gc.Equals, expect) { | 91 if !c.Check(string(got), gc.Equals, expect) { |
91 info, err := f.Stat() | 92 info, err := f.Stat() |
92 c.Assert(err, gc.IsNil) | 93 c.Assert(err, gc.IsNil) |
93 c.Logf("info %#v", info) | 94 c.Logf("info %#v", info) |
94 } | 95 } |
95 } | 96 } |
OLD | NEW |