OLD | NEW |
1 // Copyright 2013 Canonical Ltd. | 1 // Copyright 2013 Canonical Ltd. |
2 // Licensed under the AGPLv3, see LICENCE file for details. | 2 // Licensed under the AGPLv3, see LICENCE file for details. |
3 | 3 |
4 package state_test | 4 package state_test |
5 | 5 |
6 import ( | 6 import ( |
7 gc "launchpad.net/gocheck" | 7 gc "launchpad.net/gocheck" |
8 | 8 |
9 "launchpad.net/juju-core/constraints" | 9 "launchpad.net/juju-core/constraints" |
10 "launchpad.net/juju-core/environs/config" | 10 "launchpad.net/juju-core/environs/config" |
11 "launchpad.net/juju-core/errors" | 11 "launchpad.net/juju-core/errors" |
12 "launchpad.net/juju-core/state" | 12 "launchpad.net/juju-core/state" |
13 "launchpad.net/juju-core/testing" | 13 "launchpad.net/juju-core/testing" |
14 jc "launchpad.net/juju-core/testing/checkers" | 14 jc "launchpad.net/juju-core/testing/checkers" |
| 15 "launchpad.net/juju-core/testing/testbase" |
15 ) | 16 ) |
16 | 17 |
17 type InitializeSuite struct { | 18 type InitializeSuite struct { |
18 testing.MgoSuite | 19 testing.MgoSuite |
19 » testing.LoggingSuite | 20 » testbase.LoggingSuite |
20 State *state.State | 21 State *state.State |
21 } | 22 } |
22 | 23 |
23 var _ = gc.Suite(&InitializeSuite{}) | 24 var _ = gc.Suite(&InitializeSuite{}) |
24 | 25 |
25 func (s *InitializeSuite) SetUpSuite(c *gc.C) { | 26 func (s *InitializeSuite) SetUpSuite(c *gc.C) { |
26 s.LoggingSuite.SetUpSuite(c) | 27 s.LoggingSuite.SetUpSuite(c) |
27 s.MgoSuite.SetUpSuite(c) | 28 s.MgoSuite.SetUpSuite(c) |
28 } | 29 } |
29 | 30 |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 st := state.TestingInitialize(c, good) | 133 st := state.TestingInitialize(c, good) |
133 st.Close() | 134 st.Close() |
134 err = s.State.SetEnvironConfig(bad) | 135 err = s.State.SetEnvironConfig(bad) |
135 c.Assert(err, gc.ErrorMatches, "agent-version must always be set in stat
e") | 136 c.Assert(err, gc.ErrorMatches, "agent-version must always be set in stat
e") |
136 | 137 |
137 // EnvironConfig remains inviolate. | 138 // EnvironConfig remains inviolate. |
138 cfg, err := s.State.EnvironConfig() | 139 cfg, err := s.State.EnvironConfig() |
139 c.Assert(err, gc.IsNil) | 140 c.Assert(err, gc.IsNil) |
140 c.Assert(cfg.AllAttrs(), gc.DeepEquals, good.AllAttrs()) | 141 c.Assert(cfg.AllAttrs(), gc.DeepEquals, good.AllAttrs()) |
141 } | 142 } |
OLD | NEW |