Index: state/export_test.go |
=== modified file 'state/export_test.go' |
--- state/export_test.go 2014-01-25 11:45:42 +0000 |
+++ state/export_test.go 2014-02-18 05:43:06 +0000 |
@@ -94,14 +94,22 @@ |
}) |
} |
+// SetPolicy updates the State's policy field to the |
+// given Policy, and returns the old value. |
+func SetPolicy(st *State, p Policy) Policy { |
+ old := st.policy |
+ st.policy = p |
+ return old |
+} |
+ |
// 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 *gc.C, cfg *config.Config) *State { |
+func TestingInitialize(c *gc.C, cfg *config.Config, policy Policy) *State { |
if cfg == nil { |
cfg = testing.EnvironConfig(c) |
} |
- st, err := Initialize(TestingStateInfo(), cfg, TestingDialOpts()) |
+ st, err := Initialize(TestingStateInfo(), cfg, TestingDialOpts(), policy) |
c.Assert(err, gc.IsNil) |
return st |
} |