From 7ce60a47e860d8eba00521e4811c4b0a7af8dd81 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Sat, 8 Jun 2024 12:58:46 +0100 Subject: [PATCH] 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. --- backend/drive/drive_internal_test.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/backend/drive/drive_internal_test.go b/backend/drive/drive_internal_test.go index 838962759..a5cd90428 100644 --- a/backend/drive/drive_internal_test.go +++ b/backend/drive/drive_internal_test.go @@ -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) } })