()
| 223 | } |
| 224 | |
| 225 | func (s *ObjectStoreTestSuite) TestListFileObjects() { |
| 226 | // Create additional test files |
| 227 | for i := 1; i <= 3; i++ { |
| 228 | content := []byte(fmt.Sprintf("test file %d", i)) |
| 229 | param := params.CreateFileObjectParams{ |
| 230 | Name: fmt.Sprintf("list-test-%d.txt", i), |
| 231 | Size: int64(len(content)), |
| 232 | Tags: []string{"list", "test"}, |
| 233 | } |
| 234 | _, err := s.Fixtures.Store.CreateFileObject( |
| 235 | s.Fixtures.AdminContext, |
| 236 | param, |
| 237 | bytes.NewReader(content), |
| 238 | ) |
| 239 | s.Require().Nil(err) |
| 240 | } |
| 241 | |
| 242 | resp, err := s.Runner.ListFileObjects(s.Fixtures.AdminContext, 0, 25, nil) |
| 243 | |
| 244 | s.Require().Nil(err) |
| 245 | s.Require().NotNil(resp.Results) |
| 246 | s.Require().GreaterOrEqual(len(resp.Results), 4) // At least the test file + 3 new ones |
| 247 | } |
| 248 | |
| 249 | func (s *ObjectStoreTestSuite) TestListFileObjectsUnauthorized() { |
| 250 | _, err := s.Runner.ListFileObjects(s.Fixtures.UnauthorizedContext, 0, 25, nil) |
nothing calls this directly
no test coverage detected