~dave-cheney/juju-core/102-cmd-init-context

« back to all changes in this revision

Viewing changes to charm/dir_test.go

testing: add "series" argument to Repo methods.

R=niemeyer
CC=
https://codereview.appspot.com/6489117

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
var _ = Suite(&DirSuite{})
18
18
 
19
19
func (s *DirSuite) TestReadDir(c *C) {
20
 
        path := testing.Charms.DirPath("dummy")
 
20
        path := testing.Charms.DirPath("series", "dummy")
21
21
        dir, err := charm.ReadDir(path)
22
22
        c.Assert(err, IsNil)
23
23
        checkDummy(c, dir, path)
24
24
}
25
25
 
26
26
func (s *DirSuite) TestReadDirWithoutConfig(c *C) {
27
 
        path := testing.Charms.DirPath("varnish")
 
27
        path := testing.Charms.DirPath("series", "varnish")
28
28
        dir, err := charm.ReadDir(path)
29
29
        c.Assert(err, IsNil)
30
30
 
34
34
}
35
35
 
36
36
func (s *DirSuite) TestBundleTo(c *C) {
37
 
        dir := testing.Charms.Dir("dummy")
 
37
        dir := testing.Charms.Dir("series", "dummy")
38
38
        path := filepath.Join(c.MkDir(), "bundle.charm")
39
39
        file, err := os.Create(path)
40
40
        c.Assert(err, IsNil)
103
103
}
104
104
 
105
105
func (s *DirSuite) TestBundleToWithBadType(c *C) {
106
 
        charmDir := testing.Charms.ClonedDirPath(c.MkDir(), "dummy")
 
106
        charmDir := testing.Charms.ClonedDirPath(c.MkDir(), "series", "dummy")
107
107
        badFile := filepath.Join(charmDir, "hooks", "badfile")
108
108
 
109
109
        // Symlink targeting a path outside of the charm.
140
140
}
141
141
 
142
142
func (s *DirSuite) TestDirRevisionFile(c *C) {
143
 
        charmDir := testing.Charms.ClonedDirPath(c.MkDir(), "dummy")
 
143
        charmDir := testing.Charms.ClonedDirPath(c.MkDir(), "series", "dummy")
144
144
        revPath := filepath.Join(charmDir, "revision")
145
145
 
146
146
        // Missing revision file
171
171
}
172
172
 
173
173
func (s *DirSuite) TestDirSetRevision(c *C) {
174
 
        dir := testing.Charms.ClonedDir(c.MkDir(), "dummy")
 
174
        dir := testing.Charms.ClonedDir(c.MkDir(), "series", "dummy")
175
175
        c.Assert(dir.Revision(), Equals, 1)
176
176
        dir.SetRevision(42)
177
177
        c.Assert(dir.Revision(), Equals, 42)
185
185
}
186
186
 
187
187
func (s *DirSuite) TestDirSetDiskRevision(c *C) {
188
 
        charmDir := testing.Charms.ClonedDirPath(c.MkDir(), "dummy")
 
188
        charmDir := testing.Charms.ClonedDirPath(c.MkDir(), "series", "dummy")
189
189
        dir, err := charm.ReadDir(charmDir)
190
190
        c.Assert(err, IsNil)
191
191