test: `TestListEmptyDir` expected behavior does not apply to some file hosting service
JinnyYi opened this issue · comments
go-storage/tests/storager_list.go
Lines 86 to 96 in 813c8a1
path
is currently a non-existent path for the service. When listing a non-existent dir:
- For object storage services,
ListObjects
will get an emptyContents
inListBucketResult
, in line with the expected behavior. - For
fs
, althoughlist
does not return an error, we will getno such file or directory
error when callingNext()
. - For
dropbox
:ListFolder
will returnpath/not_found/...
error.
Maybe TestListEmptyDir
should list an existing empty dir?
How about CreateDir(path)
before List
? But the service should support CreateDir
feature. I'm not sure it's appropriate to check s.p.store.Features().CreateDir
in TestListEmptyDir
. If we judge in TestList
, all of test cases for List
may not be executed.
After adding CreateDir(path)
before List
, file hosting services basically passes the test now, but the object storage services no longer passes the test:
TestListEmptyDir
will get the objectworkdir/path/
with size 0 ins3
andcos
, maybe more services.TestListEmptyDir
test case will be passed when testing services3
withminio
.