Merge lp:~thumper/juju-core/bzr-isolation into lp:~go-bot/juju-core/trunk
Proposed by
Tim Penhey
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Tim Penhey | ||||
Approved revision: | no longer in the source branch. | ||||
Merged at revision: | 2513 | ||||
Proposed branch: | lp:~thumper/juju-core/bzr-isolation | ||||
Merge into: | lp:~go-bot/juju-core/trunk | ||||
Diff against target: |
45 lines (+17/-0) 1 file modified
bzr/bzr_test.go (+17/-0) |
||||
To merge this branch: | bzr merge lp:~thumper/juju-core/bzr-isolation | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju Engineering | Pending | ||
Review via email: mp+213397@code.launchpad.net |
Commit message
Isolate the bzr tests from the environment
The tests fail if the user running the tests has
not told bzr who they are using 'bzr whoami'. This
test isolates that behaviour.
Description of the change
Isolate the bzr tests from the environment
The tests fail if the user running the tests has
not told bzr who they are using 'bzr whoami'. This
test isolates that behaviour.
To post a comment you must log in.
Reviewers: mp+213397_ code.launchpad. net,
Message:
Please take a look.
Description:
Isolate the bzr tests from the environment
The tests fail if the user running the tests has
not told bzr who they are using 'bzr whoami'. This
test isolates that behaviour.
https:/ /code.launchpad .net/~thumper/ juju-core/ bzr-isolation/ +merge/ 213397
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/82250045/
Affected files (+19, -0 lines):
A [revision details]
M bzr/bzr_test.go
Index: [revision details] 20140330221944- tt65zj7hl6967aa d
=== added file '[revision details]'
--- [revision details] 2012-01-01 00:00:00 +0000
+++ [revision details] 2012-01-01 00:00:00 +0000
@@ -0,0 +1,2 @@
+Old revision: tarmac-
+New revision: <email address hidden>
Index: bzr/bzr_test.go
=== modified file 'bzr/bzr_test.go'
--- bzr/bzr_test.go 2013-08-19 11:17:19 +0000
+++ bzr/bzr_test.go 2014-03-31 01:56:29 +0000
@@ -4,13 +4,16 @@
package bzr_test
import (
+ "io/ioutil"
"os"
"os/exec"
+ "path/filepath"
"testing"
gc "launchpad. net/gocheck"
"launchpad. net/juju- core/bzr" net/juju- core/testing/ testbase"
+ "launchpad.
)
func Test(t *testing.T) { &BzrSuite{ })
@@ -20,10 +23,24 @@
var _ = gc.Suite(
type BzrSuite struct { LoggingSuite
+ testbase.
b *bzr.Branch
}
+const bzr_config = `[DEFAULT] SetUpTest( c) ent("BZR_ HOME", bzrdir) filepath. Join(bzrdir, ".bazaar"), 0755) Join(bzrdir, ".bazaar", "bazaar.conf"), s.b.Init( ), gc.IsNil)
+email = testing <email address hidden>
+`
+
func (s *BzrSuite) SetUpTest(c *gc.C) {
+ s.LoggingSuite.
+ bzrdir := c.MkDir()
+ s.PatchEnvironm
+ err := os.Mkdir(
+ c.Assert(err, gc.IsNil)
+ err = ioutil.WriteFile(
+ filepath.
+ []byte(bzr_config), 0644)
+ c.Assert(err, gc.IsNil)
s.b = bzr.New(c.MkDir())
c.Assert(
}