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

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

Issue 5901058: cmd/juju: working bootstrap and destroy commands
Left Patch Set: cmd/juju: working bootstrap and destroy commands Created 13 years, 1 month ago
Right Patch Set: cmd/juju: working bootstrap and destroy commands Created 13 years 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/jujud/main.go ('k') | cmd/jujud/provisioning.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_test 1 package main_test
2 2
3 import ( 3 import (
4 "flag" 4 "flag"
5 . "launchpad.net/gocheck" 5 . "launchpad.net/gocheck"
6 main "launchpad.net/juju/go/cmd/jujud" 6 main "launchpad.net/juju/go/cmd/jujud"
7 "os" 7 "os"
8 "os/exec" 8 "os/exec"
9 "strings" 9 "strings"
10 "testing" 10 "testing"
(...skipping 20 matching lines...) Expand all
31 ps := exec.Command(os.Args[0], args...) 31 ps := exec.Command(os.Args[0], args...)
32 output, err := ps.CombinedOutput() 32 output, err := ps.CombinedOutput()
33 c.Assert(err, ErrorMatches, "exit status 2") 33 c.Assert(err, ErrorMatches, "exit status 2")
34 lines := strings.Split(string(output), "\n") 34 lines := strings.Split(string(output), "\n")
35 c.Assert(lines[0], Equals, msg) 35 c.Assert(lines[0], Equals, msg)
36 } 36 }
37 37
38 func (s *MainSuite) TestParseErrors(c *C) { 38 func (s *MainSuite) TestParseErrors(c *C) {
39 // Check all the obvious parse errors 39 // Check all the obvious parse errors
40 checkMessage(c, "no command specified") 40 checkMessage(c, "no command specified")
41 » checkMessage(c, "unrecognised command: cavitate", "cavitate") 41 » checkMessage(c, "unrecognised command: jujud cavitate", "cavitate")
42 msgf := "flag provided but not defined: --cheese" 42 msgf := "flag provided but not defined: --cheese"
43 checkMessage(c, msgf, "--cheese", "cavitate") 43 checkMessage(c, msgf, "--cheese", "cavitate")
44 44
45 cmds := []string{"initzk", "unit", "machine", "provisioning"} 45 cmds := []string{"initzk", "unit", "machine", "provisioning"}
46 msgz := `invalid value "localhost:2181,zk" for flag --zookeeper-servers: "zk" is not a valid zookeeper address` 46 msgz := `invalid value "localhost:2181,zk" for flag --zookeeper-servers: "zk" is not a valid zookeeper address`
47 for _, cmd := range cmds { 47 for _, cmd := range cmds {
48 checkMessage(c, msgf, cmd, "--cheese") 48 checkMessage(c, msgf, cmd, "--cheese")
49 checkMessage(c, msgz, cmd, "--zookeeper-servers", "localhost:218 1,zk") 49 checkMessage(c, msgz, cmd, "--zookeeper-servers", "localhost:218 1,zk")
50 } 50 }
51 51
(...skipping 11 matching lines...) Expand all
63 checkMessage(c, msga, "machine", 63 checkMessage(c, msga, "machine",
64 "--zookeeper-servers", "zk:2181", 64 "--zookeeper-servers", "zk:2181",
65 "--session-file", "sf", 65 "--session-file", "sf",
66 "--machine-id", "42", 66 "--machine-id", "42",
67 "toastie") 67 "toastie")
68 checkMessage(c, msga, "provisioning", 68 checkMessage(c, msga, "provisioning",
69 "--zookeeper-servers", "127.0.0.1:2181", 69 "--zookeeper-servers", "127.0.0.1:2181",
70 "--session-file", "sf", 70 "--session-file", "sf",
71 "toastie") 71 "toastie")
72 } 72 }
LEFTRIGHT

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