Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(690)

Delta Between Two Patch Sets: state/conn_test.go

Issue 77820044: Add EnvironCapability to state.Policy
Left Patch Set: Created 10 years ago
Right Patch Set: Add EnvironCapability to state.Policy Created 9 years, 12 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « state/addmachine.go ('k') | state/environcapability_test.go » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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
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
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 }
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b