예제 #1
0
func (s *ConfigSuite) TestProxyValuesNotSet(c *gc.C) {
	s.addJujuFiles(c)
	config := newTestConfig(c, testing.Attrs{})
	c.Assert(config.HttpProxy(), gc.Equals, "")
	c.Assert(config.AptHttpProxy(), gc.Equals, "")
	c.Assert(config.HttpsProxy(), gc.Equals, "")
	c.Assert(config.AptHttpsProxy(), gc.Equals, "")
	c.Assert(config.FtpProxy(), gc.Equals, "")
	c.Assert(config.AptFtpProxy(), gc.Equals, "")
	c.Assert(config.NoProxy(), gc.Equals, "")
}
예제 #2
0
func (s *ConfigSuite) TestProxyValuesWithFallback(c *gc.C) {
	s.addJujuFiles(c)

	config := newTestConfig(c, testing.Attrs{
		"http-proxy":  "http://[email protected]",
		"https-proxy": "https://[email protected]",
		"ftp-proxy":   "ftp://[email protected]",
		"no-proxy":    "localhost,10.0.3.1",
	})
	c.Assert(config.HttpProxy(), gc.Equals, "http://[email protected]")
	c.Assert(config.AptHttpProxy(), gc.Equals, "http://[email protected]")
	c.Assert(config.HttpsProxy(), gc.Equals, "https://[email protected]")
	c.Assert(config.AptHttpsProxy(), gc.Equals, "https://[email protected]")
	c.Assert(config.FtpProxy(), gc.Equals, "ftp://[email protected]")
	c.Assert(config.AptFtpProxy(), gc.Equals, "ftp://[email protected]")
	c.Assert(config.NoProxy(), gc.Equals, "localhost,10.0.3.1")
}