TestPutFilePublicReadACL covers the applyACL public-read branch and the ACL().Set call against the fake server.
(c *C)
| 386 | // TestPutFilePublicReadACL covers the applyACL public-read branch and the |
| 387 | // ACL().Set call against the fake server. |
| 388 | func (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. |
nothing calls this directly
no test coverage detected