Пример #1
0
func SetFakeToolsStorage(useFake bool) {
	if useFake {
		tools.SetToolPrefix("tools_test/juju-")
	} else {
		tools.SetToolPrefix(tools.DefaultToolPrefix)
	}
}
Пример #2
0
func (s *StorageSuite) TestSetToolPrefix(c *C) {
	vers := version.MustParseBinary("1.2.3-precise-amd64")
	tools.SetToolPrefix("test_prefix/juju-")
	path := tools.StorageName(vers)
	c.Assert(path, Equals, "test_prefix/juju-1.2.3-precise-amd64.tgz")
	tools.SetToolPrefix(tools.DefaultToolPrefix)
	path = tools.StorageName(vers)
	c.Assert(path, Equals, "tools/juju-1.2.3-precise-amd64.tgz")
}