OLD | NEW |
1 package uniter_test | 1 package uniter_test |
2 | 2 |
3 import ( | 3 import ( |
4 "bytes" | 4 "bytes" |
5 "crypto/sha256" | 5 "crypto/sha256" |
6 "encoding/hex" | 6 "encoding/hex" |
7 "fmt" | 7 "fmt" |
8 "io" | 8 "io" |
9 "io/ioutil" | 9 "io/ioutil" |
10 . "launchpad.net/gocheck" | 10 . "launchpad.net/gocheck" |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 c.Logf("%#v", s) | 289 c.Logf("%#v", s) |
290 s.step(c, ctx) | 290 s.step(c, ctx) |
291 } | 291 } |
292 | 292 |
293 type createCharm struct { | 293 type createCharm struct { |
294 revision int | 294 revision int |
295 badHooks []string | 295 badHooks []string |
296 } | 296 } |
297 | 297 |
298 func (s createCharm) step(c *C, ctx *context) { | 298 func (s createCharm) step(c *C, ctx *context) { |
299 » base := coretesting.Charms.ClonedDirPath(c.MkDir(), "dummy") | 299 » base := coretesting.Charms.ClonedDirPath(c.MkDir(), "series", "dummy") |
300 for _, name := range []string{"install", "start", "config-changed", "upg
rade-charm"} { | 300 for _, name := range []string{"install", "start", "config-changed", "upg
rade-charm"} { |
301 path := filepath.Join(base, "hooks", name) | 301 path := filepath.Join(base, "hooks", name) |
302 good := true | 302 good := true |
303 for _, bad := range s.badHooks { | 303 for _, bad := range s.badHooks { |
304 if name == bad { | 304 if name == bad { |
305 good = false | 305 good = false |
306 } | 306 } |
307 } | 307 } |
308 ctx.writeHook(c, path, good) | 308 ctx.writeHook(c, path, good) |
309 } | 309 } |
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
644 f func(*C, *context) | 644 f func(*C, *context) |
645 } | 645 } |
646 | 646 |
647 func (s custom) step(c *C, ctx *context) { | 647 func (s custom) step(c *C, ctx *context) { |
648 s.f(c, ctx) | 648 s.f(c, ctx) |
649 } | 649 } |
650 | 650 |
651 func curl(revision int) *charm.URL { | 651 func curl(revision int) *charm.URL { |
652 return charm.MustParseURL("cs:series/dummy").WithRevision(revision) | 652 return charm.MustParseURL("cs:series/dummy").WithRevision(revision) |
653 } | 653 } |
OLD | NEW |