~rogpeppe/juju-core/themue-058-debug-log-api

« back to all changes in this revision

Viewing changes to juju/osenv/proxy_test.go

  • Committer: Frank Mueller
  • Date: 2014-01-23 14:14:49 UTC
  • mfrom: (2152.1.95 juju-core)
  • Revision ID: frank.mueller@canonical.com-20140123141449-b30l57y7gs3wjkpw
debugger: merged trunk and fixed permission and interface problems

Show diffs side-by-side

added added

removed removed

Lines of Context:
87
87
                Ftp:   "ftp://user@10.0.0.1",
88
88
        })
89
89
}
 
90
 
 
91
func (s *proxySuite) TestAsEnvironmentValuesEmpty(c *gc.C) {
 
92
        proxies := osenv.ProxySettings{}
 
93
        c.Assert(proxies.AsEnvironmentValues(), gc.Equals, "")
 
94
}
 
95
 
 
96
func (s *proxySuite) TestAsEnvironmentValuesOneValue(c *gc.C) {
 
97
        proxies := osenv.ProxySettings{
 
98
                Http: "some-value",
 
99
        }
 
100
        expected := `
 
101
export http_proxy=some-value
 
102
export HTTP_PROXY=some-value`[1:]
 
103
        c.Assert(proxies.AsEnvironmentValues(), gc.Equals, expected)
 
104
}
 
105
 
 
106
func (s *proxySuite) TestAsEnvironmentValuesAllValue(c *gc.C) {
 
107
        proxies := osenv.ProxySettings{
 
108
                Http:  "some-value",
 
109
                Https: "special",
 
110
                Ftp:   "who uses this?",
 
111
        }
 
112
        expected := `
 
113
export http_proxy=some-value
 
114
export HTTP_PROXY=some-value
 
115
export https_proxy=special
 
116
export HTTPS_PROXY=special
 
117
export ftp_proxy=who uses this?
 
118
export FTP_PROXY=who uses this?`[1:]
 
119
        c.Assert(proxies.AsEnvironmentValues(), gc.Equals, expected)
 
120
}