Пример #1
0
func (s *proxySuite) TestAsEnvironmentValuesOneValue(c *gc.C) {
	proxies := osenv.ProxySettings{
		Http: "some-value",
	}
	expected := []string{
		"http_proxy=some-value",
		"HTTP_PROXY=some-value",
	}
	c.Assert(proxies.AsEnvironmentValues(), gc.DeepEquals, expected)
}
Пример #2
0
func (s *proxySuite) TestAsEnvironmentValuesAllValue(c *gc.C) {
	proxies := osenv.ProxySettings{
		Http:    "some-value",
		Https:   "special",
		Ftp:     "who uses this?",
		NoProxy: "10.0.3.1,localhost",
	}
	expected := []string{
		"http_proxy=some-value",
		"HTTP_PROXY=some-value",
		"https_proxy=special",
		"HTTPS_PROXY=special",
		"ftp_proxy=who uses this?",
		"FTP_PROXY=who uses this?",
		"no_proxy=10.0.3.1,localhost",
		"NO_PROXY=10.0.3.1,localhost",
	}
	c.Assert(proxies.AsEnvironmentValues(), gc.DeepEquals, expected)
}
Пример #3
0
func (s *proxySuite) TestAsEnvironmentValuesEmpty(c *gc.C) {
	proxies := osenv.ProxySettings{}
	c.Assert(proxies.AsEnvironmentValues(), gc.HasLen, 0)
}