Skip to content

test: TestListEmptyDir expected behavior does not apply to some file hosting serviceΒ #1034

@JinnyYi

Description

@JinnyYi

func (s *storageListSuite) TestListEmptyDir() {
path := uuid.New().String()
it, err := s.p.store.List(path, ps.WithListMode(types.ListModeDir))
s.NoError(err)
s.NotNil(it)
o, err := it.Next()
s.ErrorIs(err, types.IterateDone)
s.Nil(o)
}

path is currently a non-existent path for the service. When listing a non-existent dir:

  • For object storage services, ListObjects will get an empty Contents in ListBucketResult, in line with the expected behavior.
  • For fs, although list does not return an error, we will get no such file or directory error when calling Next().
  • For dropbox: ListFolder will return path/not_found/... error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions