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

Delta Between Two Patch Sets: cmd/juju/status_test.go

Issue 6553049: all: use MgoSuite rather than ZkSuite
Left Patch Set: all: use MgoSuite rather than ZkSuite Created 12 years, 6 months ago
Right Patch Set: all: use MgoSuite rather than ZkSuite Created 12 years, 6 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 | « cmd/juju/main_test.go ('k') | cmd/jujuc/server/util_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
(no file at all)
1 package main 1 package main
2 2
3 import ( 3 import (
4 "bytes" 4 "bytes"
5 "encoding/json" 5 "encoding/json"
6 "fmt" 6 "fmt"
7 "net/url" 7 "net/url"
8 8
9 . "launchpad.net/gocheck" 9 . "launchpad.net/gocheck"
10 "launchpad.net/goyaml" 10 "launchpad.net/goyaml"
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 "agent-version": "0.0.0" , 241 "agent-version": "0.0.0" ,
242 "machine": 1, 242 "machine": 1,
243 "status": "pendin g", 243 "status": "pendin g",
244 }, 244 },
245 }, 245 },
246 }, 246 },
247 }, 247 },
248 }, 248 },
249 }, 249 },
250 250
251 » // TODO(dfc) test failing components by destructively mutating zk under the hood 251 » // TODO(dfc) test failing components by destructively mutating the state under the hood
252 } 252 }
253 253
254 func (s *StatusSuite) testStatus(format string, marshal func(v interface{}) ([]b yte, error), unmarshal func(data []byte, v interface{}) error, c *C) { 254 func (s *StatusSuite) testStatus(format string, marshal func(v interface{}) ([]b yte, error), unmarshal func(data []byte, v interface{}) error, c *C) {
255 for _, t := range statusTests { 255 for _, t := range statusTests {
256 c.Logf("testing %s: %s", format, t.title) 256 c.Logf("testing %s: %s", format, t.title)
257 t.prepare(s.State, s.Conn, c) 257 t.prepare(s.State, s.Conn, c)
258 ctx := &cmd.Context{c.MkDir(), &bytes.Buffer{}, &bytes.Buffer{}, &bytes.Buffer{}} 258 ctx := &cmd.Context{c.MkDir(), &bytes.Buffer{}, &bytes.Buffer{}, &bytes.Buffer{}}
259 code := cmd.Main(&StatusCommand{}, ctx, []string{"--format", for mat}) 259 code := cmd.Main(&StatusCommand{}, ctx, []string{"--format", for mat})
260 c.Check(code, Equals, 0) 260 c.Check(code, Equals, 0)
261 c.Assert(ctx.Stderr.(*bytes.Buffer).String(), Equals, "") 261 c.Assert(ctx.Stderr.(*bytes.Buffer).String(), Equals, "")
(...skipping 17 matching lines...) Expand all
279 } 279 }
280 } 280 }
281 281
282 func (s *StatusSuite) TestYamlStatus(c *C) { 282 func (s *StatusSuite) TestYamlStatus(c *C) {
283 s.testStatus("yaml", goyaml.Marshal, goyaml.Unmarshal, c) 283 s.testStatus("yaml", goyaml.Marshal, goyaml.Unmarshal, c)
284 } 284 }
285 285
286 func (s *StatusSuite) TestJsonStatus(c *C) { 286 func (s *StatusSuite) TestJsonStatus(c *C) {
287 s.testStatus("json", json.Marshal, json.Unmarshal, c) 287 s.testStatus("json", json.Marshal, json.Unmarshal, c)
288 } 288 }
LEFTRIGHT

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