LEFT | RIGHT |
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 Loading... |
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 Loading... |
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 } |
LEFT | RIGHT |