lsjson: update tests

This commit is contained in:
hiddenmarten 2025-01-23 21:39:07 +01:00
parent 7827ccea68
commit 09c46c0efe

View File

@ -406,13 +406,13 @@ func TestStatJSON(t *testing.T) {
})
}
func TestStatJsonAutoFilename(t *testing.T) {
func TestStatJsonMetadataContentDisposition(t *testing.T) {
ctx := context.Background()
r := fstest.NewRun(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)
got, err := operations.StatJSON(ctx, r.Fremote, "file1", &operations.ListJSONOpt{AutoFilename: true})
got, err := operations.StatJSON(ctx, r.Fremote, "file1", &operations.ListJSONOpt{Metadata: true})
require.NoError(t, err)
require.NotNil(t, got)
assert.Equal(t, "file1.txt", got.Name)