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

Delta Between Two Patch Sets: state/watcher_test.go

Issue 6244053: environs/ec2: remove unused madeBucket logic (Closed)
Left Patch Set: Created 12 years, 10 months ago
Right Patch Set: environs/ec2: remove unused madeBucket logic Created 12 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/state.go ('k') | no next file » | 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 package state_test 1 package state_test
2 2
3 import ( 3 import (
4 . "launchpad.net/gocheck" 4 . "launchpad.net/gocheck"
5 "launchpad.net/gozk/zookeeper" 5 "launchpad.net/gozk/zookeeper"
6 "launchpad.net/juju/go/state" 6 "launchpad.net/juju/go/state"
7 "time" 7 "time"
8 ) 8 )
9 9
10 var serviceWatchConfigData = []map[string]interface{}{ 10 var serviceWatchConfigData = []map[string]interface{}{
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 } 296 }
297 297
298 func (s *StateSuite) TestWatchEnvironment(c *C) { 298 func (s *StateSuite) TestWatchEnvironment(c *C) {
299 // create a blank /environment key manually as it is· 299 // create a blank /environment key manually as it is·
300 // not created by state.Init(). 300 // not created by state.Init().
301 path, err := s.zkConn.Create("/environment", "", 0, zookeeper.WorldACL(z ookeeper.PERM_ALL)) 301 path, err := s.zkConn.Create("/environment", "", 0, zookeeper.WorldACL(z ookeeper.PERM_ALL))
302 c.Assert(err, IsNil) 302 c.Assert(err, IsNil)
303 c.Assert(path, Equals, "/environment") 303 c.Assert(path, Equals, "/environment")
304 304
305 // fetch the /environment key as a *ConfigNode 305 // fetch the /environment key as a *ConfigNode
306 » w := s.st.WatchEnvrionConfig() 306 » w := s.st.WatchEnvironConfig()
307 config, ok := <-w.Changes() 307 config, ok := <-w.Changes()
308 c.Assert(ok, Equals, true) 308 c.Assert(ok, Equals, true)
309 309
310 for _, test := range environmentWatchTests { 310 for _, test := range environmentWatchTests {
311 config.Set(test.key, test.value) 311 config.Set(test.key, test.value)
312 _, err := config.Write() 312 _, err := config.Write()
313 c.Assert(err, IsNil) 313 c.Assert(err, IsNil)
314 select { 314 select {
315 case got, ok := <-w.Changes(): 315 case got, ok := <-w.Changes():
316 c.Assert(ok, Equals, true) 316 c.Assert(ok, Equals, true)
(...skipping 21 matching lines...) Expand all
338 {[]string{"B"}, []string{"A", "B", "C"}, nil}, 338 {[]string{"B"}, []string{"A", "B", "C"}, nil},
339 {[]string{"A", "D", "C"}, []string{}, []string{"A", "D", "C"}}, 339 {[]string{"A", "D", "C"}, []string{}, []string{"A", "D", "C"}},
340 {[]string{}, []string{"A", "D", "C"}, nil}, 340 {[]string{}, []string{"A", "D", "C"}, nil},
341 } 341 }
342 342
343 func (*StateSuite) TestDiff(c *C) { 343 func (*StateSuite) TestDiff(c *C) {
344 for _, test := range diffTests { 344 for _, test := range diffTests {
345 c.Assert(test.want, DeepEquals, state.Diff(test.A, test.B)) 345 c.Assert(test.want, DeepEquals, state.Diff(test.A, test.B))
346 } 346 }
347 } 347 }
LEFTRIGHT

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