github.com/artpar/rclone@v1.67.3/backend/hidrive/hidrive_test.go (about)

     1  // Test HiDrive filesystem interface
     2  package hidrive
     3  
     4  import (
     5  	"testing"
     6  
     7  	"github.com/artpar/rclone/fs"
     8  	"github.com/artpar/rclone/fstest/fstests"
     9  )
    10  
    11  // TestIntegration runs integration tests against the remote.
    12  func TestIntegration(t *testing.T) {
    13  	name := "TestHiDrive"
    14  	fstests.Run(t, &fstests.Opt{
    15  		RemoteName: name + ":",
    16  		NilObject:  (*Object)(nil),
    17  		ChunkedUpload: fstests.ChunkedUploadConfig{
    18  			MinChunkSize:       1,
    19  			MaxChunkSize:       MaximumUploadBytes,
    20  			CeilChunkSize:      nil,
    21  			NeedMultipleChunks: false,
    22  		},
    23  	})
    24  }
    25  
    26  // Change the configured UploadChunkSize.
    27  // Will only be called while no transfer is in progress.
    28  func (f *Fs) SetUploadChunkSize(chunksize fs.SizeSuffix) (fs.SizeSuffix, error) {
    29  	var old fs.SizeSuffix
    30  	old, f.opt.UploadChunkSize = f.opt.UploadChunkSize, chunksize
    31  	return old, nil
    32  }
    33  
    34  // Change the configured UploadCutoff.
    35  // Will only be called while no transfer is in progress.
    36  func (f *Fs) SetUploadCutoff(cutoff fs.SizeSuffix) (fs.SizeSuffix, error) {
    37  	var old fs.SizeSuffix
    38  	old, f.opt.UploadCutoff = f.opt.UploadCutoff, cutoff
    39  	return old, nil
    40  }
    41  
    42  var (
    43  	_ fstests.SetUploadChunkSizer = (*Fs)(nil)
    44  	_ fstests.SetUploadCutoffer   = (*Fs)(nil)
    45  )