TestPutFileUnsupportedACL covers the default (error) branch of applyACL when invoked from the production putFile flow.
(c *C)
| 400 | // TestPutFileUnsupportedACL covers the default (error) branch of applyACL |
| 401 | // when invoked from the production putFile flow. |
| 402 | func (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. |
| 416 | func (s *PublishedStorageSuite) TestPutFileWithStorageClass(c *C) { |
nothing calls this directly
no test coverage detected