fix empty dir test for object based remotes

This commit is contained in:
yparitcher 2019-08-13 16:25:11 -04:00 committed by Nick Craig-Wood
parent 898782ac35
commit 82b3bfec3c

View File

@ -494,7 +494,13 @@ func Run(t *testing.T, opt *Opt) {
TestFsListDirEmpty := func(t *testing.T) { TestFsListDirEmpty := func(t *testing.T) {
skipIfNotOk(t) skipIfNotOk(t)
objs, dirs, err := walk.GetAll(context.Background(), remote, "", true, 1) objs, dirs, err := walk.GetAll(context.Background(), remote, "", true, 1)
if !remote.Features().CanHaveEmptyDirectories {
if err != fs.ErrorDirNotFound {
require.NoError(t, err) require.NoError(t, err)
}
} else {
require.NoError(t, err)
}
assert.Equal(t, []string{}, objsToNames(objs)) assert.Equal(t, []string{}, objsToNames(objs))
assert.Equal(t, []string{}, dirsToNames(dirs)) assert.Equal(t, []string{}, dirsToNames(dirs))
} }