opendrive: run the chunked upload integration tests

Implement SetUploadChunkSizer in the tests so fstests can exercise the
chunked upload path with small chunk sizes.
This commit is contained in:
Nick Craig-Wood
2026-09-01 14:21:52 +01:00
parent a18d9a6886
commit 5fef6a84a8
2 changed files with 20 additions and 0 deletions
@@ -0,0 +1,17 @@
package opendrive
import (
"github.com/rclone/rclone/fs"
"github.com/rclone/rclone/fstest/fstests"
)
// SetUploadChunkSize changes the configured chunk size, returning the old value.
//
// It is only called by the integration tests while no transfer is in progress.
func (f *Fs) SetUploadChunkSize(cs fs.SizeSuffix) (fs.SizeSuffix, error) {
var old fs.SizeSuffix
old, f.opt.ChunkSize = f.opt.ChunkSize, cs
return old, nil
}
var _ fstests.SetUploadChunkSizer = (*Fs)(nil)
+3
View File
@@ -13,5 +13,8 @@ func TestIntegration(t *testing.T) {
fstests.Run(t, &fstests.Opt{
RemoteName: "TestOpenDrive:",
NilObject: (*opendrive.Object)(nil),
ChunkedUpload: fstests.ChunkedUploadConfig{
MinChunkSize: 1,
},
})
}