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

Method TestPutFile

gcs/public_test.go:107–119  ·  view source on GitHub ↗
(c *C)

Source from the content-addressed store, hash-verified

105}
106
107func (s *PublishedStorageSuite) TestPutFile(c *C) {
108 dir := c.MkDir()
109 err := os.WriteFile(filepath.Join(dir, "a"), []byte("welcome to gcs!"), 0644)
110 c.Assert(err, IsNil)
111
112 err = s.storage.PutFile("a/b.txt", filepath.Join(dir, "a"))
113 c.Check(err, IsNil)
114 c.Check(s.GetFile(c, "a/b.txt"), DeepEquals, []byte("welcome to gcs!"))
115
116 err = s.prefixedStorage.PutFile("a/b.txt", filepath.Join(dir, "a"))
117 c.Check(err, IsNil)
118 c.Check(s.GetFile(c, "lala/a/b.txt"), DeepEquals, []byte("welcome to gcs!"))
119}
120
121func (s *PublishedStorageSuite) TestPutFileMissingSource(c *C) {
122 err := s.storage.PutFile("a/b.txt", filepath.Join(c.MkDir(), "does-not-exist"))

Callers

nothing calls this directly

Calls 4

GetFileMethod · 0.95
MkDirMethod · 0.65
PutFileMethod · 0.65
CheckMethod · 0.45

Tested by

no test coverage detected