示例#1
0
func (*ConfigSuite) TestProxyValuesNotSet(c *gc.C) {
	defer makeFakeHome(c).Restore()

	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 (*ConfigSuite) TestProxyValuesWithFallback(c *gc.C) {
	defer makeFakeHome(c).Restore()

	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")
}