MCPcopy Create free account
hub / github.com/aptly-dev/aptly / TestFileExists

Method TestFileExists

jfrog/public_test.go:377–388  ·  view source on GitHub ↗
(c *C)

Source from the content-addressed store, hash-verified

375}
376
377func (s *PublishedStorageSuite) TestFileExists(c *C) {
378 s.manager.searchReader = createReader(c, []jfrogutils.ResultItem{{Path: "repo/prefix/pool", Name: "x"}})
379 ok, err := s.storage.FileExists("pool/x")
380 c.Assert(err, IsNil)
381 c.Assert(ok, Equals, true)
382 c.Assert(s.manager.searchParams[0].Pattern, Equals, filepath.Join("repo", "prefix", "pool/x"))
383
384 s.manager.searchReader = content.NewEmptyContentReader("results")
385 ok, err = s.storage.FileExists("pool/y")
386 c.Assert(err, IsNil)
387 c.Assert(ok, Equals, false)
388}
389
390func (s *PublishedStorageSuite) TestFileExistsSearchErrorAndPlusWorkaround(c *C) {
391 s.storage.plusWorkaround = true

Callers

nothing calls this directly

Calls 2

createReaderFunction · 0.85
FileExistsMethod · 0.65

Tested by

no test coverage detected