1
mirror of https://github.com/rclone/rclone synced 2024-11-25 02:47:14 +01:00

drive: fix tests for backend query command

The tests assumed that there would be only one match, but on the
integration test server there are multiple matches due to failed test
runs.
This commit is contained in:
Nick Craig-Wood 2024-06-08 12:58:46 +01:00
parent 27496fb26d
commit 7ce60a47e8

View File

@ -551,9 +551,11 @@ func (f *Fs) InternalTestQuery(t *testing.T) {
results, err := f.query(ctx, fmt.Sprintf("%strashed=false and name='%s'", parent, escapedItem))
require.NoError(t, err)
require.Len(t, results, 1)
assert.Len(t, results[0].Id, 33)
assert.Equal(t, results[0].Name, item)
require.True(t, len(results) > 0)
for _, result := range results {
assert.True(t, len(result.Id) > 0)
assert.Equal(t, result.Name, item)
}
parent = fmt.Sprintf("'%s' in parents and ", results[0].Id)
}
})