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

Method TestPutFilePublicReadACL

gcs/public_test.go:388–398  ·  view source on GitHub ↗

TestPutFilePublicReadACL covers the applyACL public-read branch and the ACL().Set call against the fake server.

(c *C)

Source from the content-addressed store, hash-verified

386// TestPutFilePublicReadACL covers the applyACL public-read branch and the
387// ACL().Set call against the fake server.
388func (s *PublishedStorageSuite) TestPutFilePublicReadACL(c *C) {
389 st, err := NewPublishedStorage("test", "", "", "", "", "", "public-read", "", "", false, false)
390 c.Assert(err, IsNil)
391
392 dir := c.MkDir()
393 src := filepath.Join(dir, "f")
394 c.Assert(os.WriteFile(src, []byte("hello"), 0644), IsNil)
395
396 c.Check(st.PutFile("a/b.txt", src), IsNil)
397 c.Check(s.GetFile(c, "a/b.txt"), DeepEquals, []byte("hello"))
398}
399
400// TestPutFileUnsupportedACL covers the default (error) branch of applyACL
401// when invoked from the production putFile flow.

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected