LEFT | RIGHT |
1 // Copyright 2012, 2013 Canonical Ltd. | 1 // Copyright 2012, 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 stdtesting "testing" | 7 stdtesting "testing" |
8 | 8 |
9 "labix.org/v2/mgo" | 9 "labix.org/v2/mgo" |
10 gc "launchpad.net/gocheck" | 10 gc "launchpad.net/gocheck" |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 } | 72 } |
73 | 73 |
74 func (s *ConnSuite) AddTestingCharm(c *gc.C, name string) *state.Charm { | 74 func (s *ConnSuite) AddTestingCharm(c *gc.C, name string) *state.Charm { |
75 return state.AddTestingCharm(c, s.State, name) | 75 return state.AddTestingCharm(c, s.State, name) |
76 } | 76 } |
77 | 77 |
78 func (s *ConnSuite) AddTestingService(c *gc.C, name string, ch *state.Charm) *st
ate.Service { | 78 func (s *ConnSuite) AddTestingService(c *gc.C, name string, ch *state.Charm) *st
ate.Service { |
79 return state.AddTestingService(c, s.State, name, ch) | 79 return state.AddTestingService(c, s.State, name, ch) |
80 } | 80 } |
81 | 81 |
| 82 func (s *ConnSuite) AddTestingServiceWithNetworks(c *gc.C, name string, ch *stat
e.Charm, includeNetworks, excludeNetworks []string) *state.Service { |
| 83 return state.AddTestingServiceWithNetworks(c, s.State, name, ch, include
Networks, excludeNetworks) |
| 84 } |
| 85 |
82 func (s *ConnSuite) AddSeriesCharm(c *gc.C, name, series string) *state.Charm { | 86 func (s *ConnSuite) AddSeriesCharm(c *gc.C, name, series string) *state.Charm { |
83 return state.AddCustomCharm(c, s.State, name, "", "", series, -1) | 87 return state.AddCustomCharm(c, s.State, name, "", "", series, -1) |
84 } | 88 } |
85 | 89 |
86 // AddConfigCharm clones a testing charm, replaces its config with | 90 // AddConfigCharm clones a testing charm, replaces its config with |
87 // the given YAML string and adds it to the state, using the given | 91 // the given YAML string and adds it to the state, using the given |
88 // revision. | 92 // revision. |
89 func (s *ConnSuite) AddConfigCharm(c *gc.C, name, configYaml string, revision in
t) *state.Charm { | 93 func (s *ConnSuite) AddConfigCharm(c *gc.C, name, configYaml string, revision in
t) *state.Charm { |
90 return state.AddCustomCharm(c, s.State, name, "config.yaml", configYaml,
"quantal", revision) | 94 return state.AddCustomCharm(c, s.State, name, "config.yaml", configYaml,
"quantal", revision) |
91 } | 95 } |
(...skipping 23 matching lines...) Expand all Loading... |
115 } | 119 } |
116 return nil, errors.NewNotImplementedError("ConfigValidator") | 120 return nil, errors.NewNotImplementedError("ConfigValidator") |
117 } | 121 } |
118 | 122 |
119 func (p *mockPolicy) EnvironCapability(cfg *config.Config) (state.EnvironCapabil
ity, error) { | 123 func (p *mockPolicy) EnvironCapability(cfg *config.Config) (state.EnvironCapabil
ity, error) { |
120 if p.getEnvironCapability != nil { | 124 if p.getEnvironCapability != nil { |
121 return p.getEnvironCapability(cfg) | 125 return p.getEnvironCapability(cfg) |
122 } | 126 } |
123 return nil, errors.NewNotImplementedError("EnvironCapability") | 127 return nil, errors.NewNotImplementedError("EnvironCapability") |
124 } | 128 } |
LEFT | RIGHT |