func (s *BootstrapSuite) SetUpTest(c *gc.C) { s.FakeJujuHomeSuite.SetUpTest(c) s.MgoSuite.SetUpTest(c) s.ToolsFixture.SetUpTest(c) // Set up a local source with tools. sourceDir := createToolsSource(c, vAll) s.PatchValue(&envtools.DefaultBaseURL, sourceDir) s.PatchValue(&envtools.BundleTools, toolstesting.GetMockBundleTools(c)) }
func (s *BootstrapSuite) setupAutoUploadTest(c *gc.C, vers, series string) environs.Environ { s.PatchValue(&envtools.BundleTools, toolstesting.GetMockBundleTools(c)) sourceDir := createToolsSource(c, vAll) s.PatchValue(&envtools.DefaultBaseURL, sourceDir) // Change the tools location to be the test location and also // the version and ensure their later restoring. // Set the current version to be something for which there are no tools // so we can test that an upload is forced. origVersion := version.Current version.Current.Number = version.MustParse(vers) version.Current.Series = series s.AddCleanup(func(*gc.C) { version.Current = origVersion }) // Create home with dummy provider and remove all // of its envtools. return resetJujuHome(c) }