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

Method TestPutFileUnsupportedACL

gcs/public_test.go:402–413  ·  view source on GitHub ↗

TestPutFileUnsupportedACL covers the default (error) branch of applyACL when invoked from the production putFile flow.

(c *C)

Source from the content-addressed store, hash-verified

400// TestPutFileUnsupportedACL covers the default (error) branch of applyACL
401// when invoked from the production putFile flow.
402func (s *PublishedStorageSuite) TestPutFileUnsupportedACL(c *C) {
403 st, err := NewPublishedStorage("test", "", "", "", "", "", "bucket-owner-full-control", "", "", false, false)
404 c.Assert(err, IsNil)
405
406 dir := c.MkDir()
407 src := filepath.Join(dir, "f")
408 c.Assert(os.WriteFile(src, []byte("hello"), 0644), IsNil)
409
410 err = st.PutFile("a/b.txt", src)
411 c.Assert(err, NotNil)
412 c.Check(err, ErrorMatches, ".*unsupported GCS ACL value.*")
413}
414
415// TestPutFileWithStorageClass covers the storageClass branch in putFile.
416func (s *PublishedStorageSuite) TestPutFileWithStorageClass(c *C) {

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected