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

Delta Between Two Patch Sets: cmd/jujud/main_test.go

Issue 7375053: Add a composed base class for commands.
Left Patch Set: Add a composed base class for commands. Created 12 years, 1 month ago
Right Patch Set: Add a composed base class for commands. Created 12 years, 1 month 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 | « cmd/jujud/machine.go ('k') | cmd/jujud/unit.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 main 1 package main
2 2
3 import ( 3 import (
4 "errors" 4 "errors"
5 "flag" 5 "flag"
6 "fmt" 6 "fmt"
7 "io/ioutil" 7 "io/ioutil"
8 "launchpad.net/gnuflag" 8 "launchpad.net/gnuflag"
9 . "launchpad.net/gocheck" 9 . "launchpad.net/gocheck"
10 "launchpad.net/juju-core/cmd" 10 "launchpad.net/juju-core/cmd"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 checkMessage(c, msgf, "--cheese", "cavitate") 69 checkMessage(c, msgf, "--cheese", "cavitate")
70 70
71 cmds := []string{"bootstrap-state", "unit", "machine"} 71 cmds := []string{"bootstrap-state", "unit", "machine"}
72 for _, cmd := range cmds { 72 for _, cmd := range cmds {
73 checkMessage(c, msgf, cmd, "--cheese") 73 checkMessage(c, msgf, cmd, "--cheese")
74 } 74 }
75 75
76 msga := `unrecognized args: ["toastie"]` 76 msga := `unrecognized args: ["toastie"]`
77 checkMessage(c, msga, 77 checkMessage(c, msga,
78 "bootstrap-state", 78 "bootstrap-state",
79 "--instance-id", "ii",
80 "--env-config", b64yaml{"blah": "blah"}.encode(), 79 "--env-config", b64yaml{"blah": "blah"}.encode(),
81 "toastie") 80 "toastie")
82 checkMessage(c, msga, "unit", 81 checkMessage(c, msga, "unit",
83 "--unit-name", "un/0", 82 "--unit-name", "un/0",
84 "toastie") 83 "toastie")
85 checkMessage(c, msga, "machine", 84 checkMessage(c, msga, "machine",
86 "--machine-id", "42", 85 "--machine-id", "42",
87 "toastie") 86 "toastie")
88 } 87 }
89 88
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 output := run(c, "", "bill", 1, "remote") 216 output := run(c, "", "bill", 1, "remote")
218 c.Assert(output, Equals, "error: JUJU_AGENT_SOCKET not set\n") 217 c.Assert(output, Equals, "error: JUJU_AGENT_SOCKET not set\n")
219 } 218 }
220 219
221 func (s *JujuCMainSuite) TestBadSockPath(c *C) { 220 func (s *JujuCMainSuite) TestBadSockPath(c *C) {
222 badSock := filepath.Join(c.MkDir(), "bad.sock") 221 badSock := filepath.Join(c.MkDir(), "bad.sock")
223 output := run(c, badSock, "bill", 1, "remote") 222 output := run(c, badSock, "bill", 1, "remote")
224 err := fmt.Sprintf("error: dial unix %s: .*\n", badSock) 223 err := fmt.Sprintf("error: dial unix %s: .*\n", badSock)
225 c.Assert(output, Matches, err) 224 c.Assert(output, Matches, err)
226 } 225 }
LEFTRIGHT

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