lsjson: skip test if set metadata is not supported

This commit is contained in:
hiddenmarten 2025-01-26 11:37:31 +01:00
parent 09c46c0efe
commit e2253ba10c

View File

@ -412,6 +412,12 @@ func TestStatJsonMetadataContentDisposition(t *testing.T) {
file1 := fstest.Item{Path: "file1", ModTime: t1, Size: 5}
metadata := fs.Metadata{"content-disposition": "Attachment; filename=file1.txt"}
fstests.PutTestContentsMetadata(ctx, t, r.Fremote, &file1, false, "file1", true, "", metadata)
// Skip the test if the remote doesn't support SetMetadata
obj := fstest.NewObject(ctx, t, r.Fremote, file1.Path)
_, objectHasSetMetadata := obj.(fs.SetMetadataer)
if !objectHasSetMetadata {
t.Skip("SetMetadata method not supported")
}
got, err := operations.StatJSON(ctx, r.Fremote, "file1", &operations.ListJSONOpt{Metadata: true})
require.NoError(t, err)
require.NotNil(t, got)