Merge lp:~thumper/juju-core/invalid-state-rename 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: | 1293 |
Proposed branch: | lp:~thumper/juju-core/invalid-state-rename |
Merge into: | lp:~go-bot/juju-core/trunk |
Diff against target: |
174 lines (+30/-29) 6 files modified
environs/ec2/live_test.go (+1/-1) environs/jujutest/livetests.go (+2/-2) juju/testing/conn.go (+6/-6) state/export_test.go (+1/-16) state/initialize_test.go (+4/-4) testing/environ.go (+16/-0) |
To merge this branch: | bzr merge lp:~thumper/juju-core/invalid-state-rename |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju Engineering | Pending | ||
Review via email: mp+169962@code.launchpad.net |
Commit message
Some testing code refactoring.
Move state.TestingEn
rename to EnvironConfig, so usage looks like testing.
Also renamed InvalidStateInfo and InvalidAPIInfo to FakeStateInfo
and FakeAIInfo.
Description of the change
Some testing code refactoring.
Move state.TestingEn
rename to EnvironConfig, so usage looks like testing.
Also renamed InvalidStateInfo and InvalidApiInfo to FakeStateInfo
and FakeApiInfo.
To post a comment you must log in.
Reviewers: mp+169962_ code.launchpad. net,
Message:
Please take a look.
Description:
Some testing code refactoring.
Move state.TestingEn vironConfig into testing/environ.go and EnvironConfig.
rename to EnvironConfig, so usage looks like testing.
Also renamed InvalidStateInfo and InvalidApiInfo to FakeStateInfo
and FakeApiInfo.
https:/ /code.launchpad .net/~thumper/ juju-core/ invalid- state-rename/ +merge/ 169962
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/10344044/
Affected files: ec2/live_ test.go jujutest/ livetests. go conn.go test.go e_test. go
A [revision details]
M environs/
M environs/
M juju/testing/
M state/export_
M state/initializ
M testing/environ.go
Index: [revision details]
=== 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: <email address hidden>
+New revision: <email address hidden>
Index: state/export_ test.go export_ test.go' test.go 2013-06-14 00:24:13 +0000 test.go 2013-06-17 22:52:36 +0000
=== modified file 'state/
--- state/export_
+++ state/export_
@@ -15,27 +15,12 @@
"path/filepath"
)
-// TestingEnvironC onfig returns a default environment configuration. onfig(c *C) *config.Config { New(map[ string] interface{ }{ onfig(c) EnvironConfig( c) TestingStateInf o(), cfg, TestingDialOpts())
-func TestingEnvironC
- cfg, err := config.
- "type": "test",
- "name": "test-name",
- "default-series": "test-series",
- "authorized-keys": "test-keys",
- "agent-version": "9.9.9.9",
- "ca-cert": testing.CACert,
- "ca-private-key": "",
- })
- c.Assert(err, IsNil)
- return cfg
-}
-
// TestingInitialize initializes the state and returns it. If state was not
// already initialized, and cfg is nil, the minimal default environment
// configuration will be used.
func TestingInitialize(c *C, cfg *config.Config) *State {
if cfg == nil {
- cfg = TestingEnvironC
+ cfg = testing.
}
st, err := Initialize(
c.Assert(err, IsNil)
Index: state/initializ e_test. go initialize_ test.go' e_test. go 2013-05-30 00:47:30 +0000 e_test. go 2013-06-17 22:52:36 +0000 EnvironConstrai nts() errors. IsNotFoundError (err), Equals, true)
=== modified file 'state/
--- state/initializ
+++ state/initializ
@@ -52,7 +52,7 @@
_, err = s.State.
c.Assert(
- cfg := state.TestingEn vironConfig( c) EnvironConfig( c) e(state. TestingStateInf o(), cfg, alOpts( ))
+ cfg := testing.
initial := cfg.AllAttrs()
st, err := state.Initializ
state.TestingDi
c.Assert(err, IsNil)
@@ -74,7 +74,7 @@
}
func (s *InitializeSuite) TestDoubleIniti alizeConfig( c *C) { vironConfig( c) EnvironConfig( c) itialize( c, cfg)
- cfg := state.TestingEn
+ cfg := testing.
initial := cfg.AllAttrs()
st := state.TestingIn
st.Close()
@@ -96,7 +96,7 @@
func (s *InitializeSuite) TestEnvironConf igWithAdminSecr et(c *C) { vironConfig( c) EnvironConfig( c) map[string] interface{ }{"admin- secret" : "foo"})
// admin-secret blocks Initialize.
- good := state.TestingEn
+ good := testing.
bad, err := good.Apply(
_, err...