mirror of
https://github.com/rclone/rclone.git
synced 2025-04-19 01:59:00 +08:00
lsjson: skip test if set metadata is not supported
This commit is contained in:
parent
09c46c0efe
commit
e2253ba10c
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user