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

Delta Between Two Patch Sets: store/branch_test.go

Issue 6495086: testing: make charm API into a test fixture.
Left Patch Set: Created 11 years, 6 months ago
Right Patch Set: testing: make charm API into a test fixture. Created 11 years, 6 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:
Left: Side by side diff | Download
Right: Side by side diff | Download
LEFTRIGHT
1 package store_test 1 package store_test
2 2
3 import ( 3 import (
4 "bytes" 4 "bytes"
5 "fmt" 5 "fmt"
6 "io/ioutil" 6 "io/ioutil"
7 . "launchpad.net/gocheck" 7 . "launchpad.net/gocheck"
8 "launchpad.net/juju-core/charm" 8 "launchpad.net/juju-core/charm"
9 "launchpad.net/juju-core/store" 9 "launchpad.net/juju-core/store"
10 "os" 10 "os"
11 "os/exec" 11 "os/exec"
12 "path/filepath" 12 "path/filepath"
13 "strings" 13 "strings"
14 "time" 14 "time"
15 ) 15 )
16 16
17 func (s *StoreSuite) dummyBranch(c *C, suffix string) bzrDir { 17 func (s *StoreSuite) dummyBranch(c *C, suffix string) bzrDir {
18 tmpDir := c.MkDir() 18 tmpDir := c.MkDir()
19 if suffix != "" { 19 if suffix != "" {
20 tmpDir = filepath.Join(tmpDir, suffix) 20 tmpDir = filepath.Join(tmpDir, suffix)
21 err := os.MkdirAll(tmpDir, 0755) 21 err := os.MkdirAll(tmpDir, 0755)
22 c.Assert(err, IsNil) 22 c.Assert(err, IsNil)
23 } 23 }
24 branch := bzrDir(tmpDir) 24 branch := bzrDir(tmpDir)
25 branch.init() 25 branch.init()
26 26
27 » copyCharmDir(branch.path(), s.CharmDir("series", "dummy")) 27 » copyCharmDir(branch.path(), s.Repo.Dir("dummy"))
28 branch.add() 28 branch.add()
29 branch.commit("Imported charm.") 29 branch.commit("Imported charm.")
30 return branch 30 return branch
31 } 31 }
32 32
33 var urls = []*charm.URL{ 33 var urls = []*charm.URL{
34 charm.MustParseURL("cs:~joe/oneiric/dummy"), 34 charm.MustParseURL("cs:~joe/oneiric/dummy"),
35 charm.MustParseURL("cs:oneiric/dummy"), 35 charm.MustParseURL("cs:oneiric/dummy"),
36 } 36 }
37 37
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 } 223 }
224 bundle, err := charm.ReadBundleBytes(b.Bytes()) 224 bundle, err := charm.ReadBundleBytes(b.Bytes())
225 if err != nil { 225 if err != nil {
226 panic(err) 226 panic(err)
227 } 227 }
228 err = bundle.ExpandTo(dst) 228 err = bundle.ExpandTo(dst)
229 if err != nil { 229 if err != nil {
230 panic(err) 230 panic(err)
231 } 231 }
232 } 232 }
LEFTRIGHT

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