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

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

Issue 6408049: environs: turn environment configuration into a concrete type
Left Patch Set: Created 12 years, 8 months ago
Right Patch Set: environs: turn environment configuration into a concrete type Created 12 years, 8 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/deploy_test.go ('k') | environs/config.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 "flag" 4 "flag"
5 "fmt" 5 "fmt"
6 "io/ioutil" 6 "io/ioutil"
7 . "launchpad.net/gocheck" 7 . "launchpad.net/gocheck"
8 _ "launchpad.net/juju-core/environs/dummy" 8 _ "launchpad.net/juju-core/environs/dummy"
9 "launchpad.net/juju-core/testing" 9 "launchpad.net/juju-core/testing"
10 "os" 10 "os"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 c.Assert(lines[0], Equals, "usage: juju [options] <command> ...") 82 c.Assert(lines[0], Equals, "usage: juju [options] <command> ...")
83 assertError(c, lines, "error: flag provided but not defined: --environme nt") 83 assertError(c, lines, "error: flag provided but not defined: --environme nt")
84 } 84 }
85 85
86 var brokenConfig = ` 86 var brokenConfig = `
87 environments: 87 environments:
88 one: 88 one:
89 type: dummy 89 type: dummy
90 zookeeper: false 90 zookeeper: false
91 broken: true 91 broken: true
92 authorized-keys: i-am-a-key
92 ` 93 `
93 94
94 // Induce failure to load environments and hence break Run. 95 // Induce failure to load environments and hence break Run.
95 func breakJuju(c *C) (string, func()) { 96 func breakJuju(c *C) (string, func()) {
96 home := os.Getenv("HOME") 97 home := os.Getenv("HOME")
97 path := c.MkDir() 98 path := c.MkDir()
98 os.Setenv("HOME", path) 99 os.Setenv("HOME", path)
99 100
100 jujuDir := filepath.Join(path, ".juju") 101 jujuDir := filepath.Join(path, ".juju")
101 err := os.Mkdir(jujuDir, 0777) 102 err := os.Mkdir(jujuDir, 0777)
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 f := strings.Fields(lines[0]) 160 f := strings.Fields(lines[0])
160 if len(f) == 0 { 161 if len(f) == 0 {
161 continue 162 continue
162 } 163 }
163 c.Assert(f, Not(HasLen), 0) 164 c.Assert(f, Not(HasLen), 0)
164 names = append(names, f[0]) 165 names = append(names, f[0])
165 } 166 }
166 sort.Strings(names) 167 sort.Strings(names)
167 c.Assert(names, DeepEquals, commandNames) 168 c.Assert(names, DeepEquals, commandNames)
168 } 169 }
LEFTRIGHT

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