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

Delta Between Two Patch Sets: state/service_test.go

Issue 8626043: juju: remove dependency on api/params
Left Patch Set: Created 10 years, 11 months ago
Right Patch Set: juju: remove dependency on api/params Created 10 years, 11 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/service.go ('k') | state/statecmd/config.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 package state_test 1 package state_test
2 2
3 import ( 3 import (
4 "fmt" 4 "fmt"
5 "labix.org/v2/mgo" 5 "labix.org/v2/mgo"
6 . "launchpad.net/gocheck" 6 . "launchpad.net/gocheck"
7 "launchpad.net/juju-core/charm" 7 "launchpad.net/juju-core/charm"
8 "launchpad.net/juju-core/constraints" 8 "launchpad.net/juju-core/constraints"
9 "launchpad.net/juju-core/state" 9 "launchpad.net/juju-core/state"
10 "sort" 10 "sort"
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 c.Assert(cfg.Map(), DeepEquals, expectVals) 172 c.Assert(cfg.Map(), DeepEquals, expectVals)
173 } 173 }
174 174
175 err = svc.Destroy() 175 err = svc.Destroy()
176 c.Assert(err, IsNil) 176 c.Assert(err, IsNil)
177 } 177 }
178 } 178 }
179 179
180 func serviceSet(options map[string]string) func(svc *state.Service) error { 180 func serviceSet(options map[string]string) func(svc *state.Service) error {
181 return func(svc *state.Service) error { 181 return func(svc *state.Service) error {
182 » » return svc.Set(options) 182 » » return svc.SetConfig(options)
183 } 183 }
184 } 184 }
185 185
186 func serviceSetYAML(yaml string) func(svc *state.Service) error { 186 func serviceSetYAML(yaml string) func(svc *state.Service) error {
187 return func(svc *state.Service) error { 187 return func(svc *state.Service) error {
188 » » return svc.SetYAML([]byte(yaml)) 188 » » return svc.SetConfigYAML([]byte(yaml))
189 } 189 }
190 } 190 }
191 191
192 var serviceSetTests = []struct { 192 var serviceSetTests = []struct {
193 about string 193 about string
194 initial map[string]interface{} 194 initial map[string]interface{}
195 set func(st *state.Service) error 195 set func(st *state.Service) error
196 expect map[string]interface{} // resulting configuration of the dummy s ervice. 196 expect map[string]interface{} // resulting configuration of the dummy s ervice.
197 err string // error regex 197 err string // error regex
198 }{{ 198 }{{
(...skipping 1413 matching lines...) Expand 10 before | Expand all | Expand 10 after
1612 func (s *ServiceSuite) TestAnnotationRemovalForService(c *C) { 1612 func (s *ServiceSuite) TestAnnotationRemovalForService(c *C) {
1613 annotations := map[string]string{"mykey": "myvalue"} 1613 annotations := map[string]string{"mykey": "myvalue"}
1614 err := s.mysql.SetAnnotations(annotations) 1614 err := s.mysql.SetAnnotations(annotations)
1615 c.Assert(err, IsNil) 1615 c.Assert(err, IsNil)
1616 err = s.mysql.Destroy() 1616 err = s.mysql.Destroy()
1617 c.Assert(err, IsNil) 1617 c.Assert(err, IsNil)
1618 ann, err := s.mysql.Annotations() 1618 ann, err := s.mysql.Annotations()
1619 c.Assert(err, IsNil) 1619 c.Assert(err, IsNil)
1620 c.Assert(ann, DeepEquals, make(map[string]string)) 1620 c.Assert(ann, DeepEquals, make(map[string]string))
1621 } 1621 }
LEFTRIGHT

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