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

Delta Between Two Patch Sets: state/conn_test.go

Issue 99640044: Actions() added to Charm interface
Left Patch Set: Created 10 years, 10 months ago
Right Patch Set: Actions() added to Charm interface Created 10 years, 10 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:
Right: Side by side diff | Download
« no previous file with change/comment | « state/charm_test.go ('k') | state/state.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
(no file at all)
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 "github.com/juju/errors" 9 "github.com/juju/errors"
10 "labix.org/v2/mgo" 10 "labix.org/v2/mgo"
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 return state.AddCustomCharm(c, s.State, name, "", "", series, -1) 87 return state.AddCustomCharm(c, s.State, name, "", "", series, -1)
88 } 88 }
89 89
90 // AddConfigCharm clones a testing charm, replaces its config with 90 // AddConfigCharm clones a testing charm, replaces its config with
91 // 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
92 // revision. 92 // revision.
93 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 {
94 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)
95 } 95 }
96 96
97 // AddActionsCharm clones a testing charm, replaces its actions schema with
98 // the given YAML, and adds it to the state, using the given revision.
99 func (s *ConnSuite) AddActionsCharm(c *gc.C, name, actionsYaml string, revision int) *state.Charm {
100 return state.AddCustomCharm(c, s.State, name, "actions.yaml", actionsYam l, "quantal", revision)
101 }
102
97 // AddMetaCharm clones a testing charm, replaces its metadata with the 103 // AddMetaCharm clones a testing charm, replaces its metadata with the
98 // given YAML string and adds it to the state, using the given revision. 104 // given YAML string and adds it to the state, using the given revision.
99 func (s *ConnSuite) AddMetaCharm(c *gc.C, name, metaYaml string, revsion int) *s tate.Charm { 105 func (s *ConnSuite) AddMetaCharm(c *gc.C, name, metaYaml string, revsion int) *s tate.Charm {
100 return state.AddCustomCharm(c, s.State, name, "metadata.yaml", metaYaml, "quantal", revsion) 106 return state.AddCustomCharm(c, s.State, name, "metadata.yaml", metaYaml, "quantal", revsion)
101 } 107 }
102 108
103 type mockPolicy struct { 109 type mockPolicy struct {
104 getPrechecker func(*config.Config) (state.Prechecker, error) 110 getPrechecker func(*config.Config) (state.Prechecker, error)
105 getConfigValidator func(string) (state.ConfigValidator, error) 111 getConfigValidator func(string) (state.ConfigValidator, error)
106 getEnvironCapability func(*config.Config) (state.EnvironCapability, e rror) 112 getEnvironCapability func(*config.Config) (state.EnvironCapability, e rror)
(...skipping 28 matching lines...) Expand all
135 } 141 }
136 return nil, errors.NewNotImplemented(nil, "ConstraintsValidator") 142 return nil, errors.NewNotImplemented(nil, "ConstraintsValidator")
137 } 143 }
138 144
139 func (p *mockPolicy) InstanceDistributor(cfg *config.Config) (state.InstanceDist ributor, error) { 145 func (p *mockPolicy) InstanceDistributor(cfg *config.Config) (state.InstanceDist ributor, error) {
140 if p.getInstanceDistributor != nil { 146 if p.getInstanceDistributor != nil {
141 return p.getInstanceDistributor(cfg) 147 return p.getInstanceDistributor(cfg)
142 } 148 }
143 return nil, errors.NewNotImplemented(nil, "InstanceDistributor") 149 return nil, errors.NewNotImplemented(nil, "InstanceDistributor")
144 } 150 }
LEFTRIGHT

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