示例#1
0
文件: repo_test.go 项目: bz2/charm
func (s *StoreSuite) TestInfoDNSError(c *gc.C) {
	store := charm.NewStore("http://127.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)
}
示例#2
0
文件: repo_test.go 项目: bz2/charm
func (s *StoreSuite) SetUpTest(c *gc.C) {
	s.FakeHomeSuite.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
}