func (s *StoreSuite) TestInfoDNSError(c *gc.C) { store := charm.NewStore("http://0.1.2.3") charmURL := charm.MustParseURL("cs:series/good") resp, err := store.Info(charmURL) c.Assert(resp, gc.IsNil) expect := `Cannot access the charm store. .*` c.Assert(err, gc.ErrorMatches, expect) }
func (s *StoreSuite) SetUpTest(c *gc.C) { s.LoggingSuite.SetUpTest(c) s.PatchValue(&charm.CacheDir, c.MkDir()) s.store = charm.NewStore(s.server.Address()) s.server.Downloads = nil s.server.Authorizations = nil s.server.Metadata = nil s.server.DownloadsNoStats = nil s.server.InfoRequestCount = 0 s.server.InfoRequestCountNoStats = 0 }