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

Method TestFileExists

swift/public_test.go:230–245  ·  view source on GitHub ↗
(c *C)

Source from the content-addressed store, hash-verified

228}
229
230func (s *PublishedStorageSuite) TestFileExists(c *C) {
231 dir := c.MkDir()
232 err := os.WriteFile(filepath.Join(dir, "a"), []byte("welcome to swift!"), 0644)
233 c.Assert(err, IsNil)
234
235 err = s.storage.PutFile("a/b.txt", filepath.Join(dir, "a"))
236 c.Check(err, IsNil)
237
238 exists, err := s.storage.FileExists("a/b.txt")
239 c.Check(err, IsNil)
240 c.Check(exists, Equals, true)
241
242 exists, err = s.storage.FileExists("a/b.invalid")
243 c.Check(err, IsNil)
244 c.Check(exists, Equals, false)
245}

Callers

nothing calls this directly

Calls 4

MkDirMethod · 0.65
PutFileMethod · 0.65
FileExistsMethod · 0.65
CheckMethod · 0.45

Tested by

no test coverage detected