"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files
Go azure-blobazure-blob-storageazure-filesbackblaze-b2cloud-storagedropboxencryptionftpfuse-filesystemgogolanggoogle-cloud-storagegoogle-driveonedriveopenstack-swiftrclones3sftpsyncwebdav
yandex: fix fs.Name()
Nick Craig-Wood6c3bf629a1d7
diff --git a/amazonclouddrive/amazonclouddrive_test.go b/amazonclouddrive/amazonclouddrive_test.goindex 20dad31c1..d35a98659 100644--- a/amazonclouddrive/amazonclouddrive_test.go+++ b/amazonclouddrive/amazonclouddrive_test.go@@ -20,6 +20,8 @@ func TestSetup(t *testing.T) {// Generic tests for the Fsfunc TestInit(t *testing.T) { fstests.TestInit(t) }func TestFsString(t *testing.T) { fstests.TestFsString(t) }+func TestFsName(t *testing.T) { fstests.TestFsName(t) }+func TestFsRoot(t *testing.T) { fstests.TestFsRoot(t) }func TestFsRmdirEmpty(t *testing.T) { fstests.TestFsRmdirEmpty(t) }func TestFsRmdirNotFound(t *testing.T) { fstests.TestFsRmdirNotFound(t) }func TestFsMkdir(t *testing.T) { fstests.TestFsMkdir(t) }diff --git a/b2/b2_test.go b/b2/b2_test.goindex 8817d8181..d68bfb12d 100644--- a/b2/b2_test.go+++ b/b2/b2_test.go@@ -20,6 +20,8 @@ func TestSetup(t *testing.T) {// Generic tests for the Fsfunc TestInit(t *testing.T) { fstests.TestInit(t) }func TestFsString(t *testing.T) { fstests.TestFsString(t) }+func TestFsName(t *testing.T) { fstests.TestFsName(t) }+func TestFsRoot(t *testing.T) { fstests.TestFsRoot(t) }func TestFsRmdirEmpty(t *testing.T) { fstests.TestFsRmdirEmpty(t) }func TestFsRmdirNotFound(t *testing.T) { fstests.TestFsRmdirNotFound(t) }func TestFsMkdir(t *testing.T) { fstests.TestFsMkdir(t) }diff --git a/crypt/crypt2_test.go b/crypt/crypt2_test.goindex 1c059a802..5ac0a0933 100644--- a/crypt/crypt2_test.go+++ b/crypt/crypt2_test.go@@ -21,6 +21,8 @@ func TestSetup2(t *testing.T) {// Generic tests for the Fsfunc TestInit2(t *testing.T) { fstests.TestInit(t) }func TestFsString2(t *testing.T) { fstests.TestFsString(t) }+func TestFsName2(t *testing.T) { fstests.TestFsName(t) }+func TestFsRoot2(t *testing.T) { fstests.TestFsRoot(t) }func TestFsRmdirEmpty2(t *testing.T) { fstests.TestFsRmdirEmpty(t) }func TestFsRmdirNotFound2(t *testing.T) { fstests.TestFsRmdirNotFound(t) }func TestFsMkdir2(t *testing.T) { fstests.TestFsMkdir(t) }diff --git a/crypt/crypt3_test.go b/crypt/crypt3_test.goindex 605efd480..84d989a0a 100644--- a/crypt/crypt3_test.go+++ b/crypt/crypt3_test.go@@ -21,6 +21,8 @@ func TestSetup3(t *testing.T) {// Generic tests for the Fsfunc TestInit3(t *testing.T) { fstests.TestInit(t) }func TestFsString3(t *testing.T) { fstests.TestFsString(t) }+func TestFsName3(t *testing.T) { fstests.TestFsName(t) }+func TestFsRoot3(t *testing.T) { fstests.TestFsRoot(t) }func TestFsRmdirEmpty3(t *testing.T) { fstests.TestFsRmdirEmpty(t) }func TestFsRmdirNotFound3(t *testing.T) { fstests.TestFsRmdirNotFound(t) }func TestFsMkdir3(t *testing.T) { fstests.TestFsMkdir(t) }diff --git a/crypt/crypt_test.go b/crypt/crypt_test.goindex 613cad365..d684c7580 100644--- a/crypt/crypt_test.go+++ b/crypt/crypt_test.go@@ -21,6 +21,8 @@ func TestSetup(t *testing.T) {// Generic tests for the Fsfunc TestInit(t *testing.T) { fstests.TestInit(t) }func TestFsString(t *testing.T) { fstests.TestFsString(t) }+func TestFsName(t *testing.T) { fstests.TestFsName(t) }+func TestFsRoot(t *testing.T) { fstests.TestFsRoot(t) }func TestFsRmdirEmpty(t *testing.T) { fstests.TestFsRmdirEmpty(t) }func TestFsRmdirNotFound(t *testing.T) { fstests.TestFsRmdirNotFound(t) }func TestFsMkdir(t *testing.T) { fstests.TestFsMkdir(t) }diff --git a/drive/drive_test.go b/drive/drive_test.goindex 4f48a2206..7c5fa0820 100644--- a/drive/drive_test.go+++ b/drive/drive_test.go@@ -20,6 +20,8 @@ func TestSetup(t *testing.T) {// Generic tests for the Fsfunc TestInit(t *testing.T) { fstests.TestInit(t) }func TestFsString(t *testing.T) { fstests.TestFsString(t) }+func TestFsName(t *testing.T) { fstests.TestFsName(t) }+func TestFsRoot(t *testing.T) { fstests.TestFsRoot(t) }func TestFsRmdirEmpty(t *testing.T) { fstests.TestFsRmdirEmpty(t) }func TestFsRmdirNotFound(t *testing.T) { fstests.TestFsRmdirNotFound(t) }func TestFsMkdir(t *testing.T) { fstests.TestFsMkdir(t) }diff --git a/dropbox/dropbox_test.go b/dropbox/dropbox_test.goindex 3d79893ac..6e39ea6be 100644--- a/dropbox/dropbox_test.go+++ b/dropbox/dropbox_test.go@@ -20,6 +20,8 @@ func TestSetup(t *testing.T) {// Generic tests for the Fsfunc TestInit(t *testing.T) { fstests.TestInit(t) }func TestFsString(t *testing.T) { fstests.TestFsString(t) }+func TestFsName(t *testing.T) { fstests.TestFsName(t) }+func TestFsRoot(t *testing.T) { fstests.TestFsRoot(t) }func TestFsRmdirEmpty(t *testing.T) { fstests.TestFsRmdirEmpty(t) }func TestFsRmdirNotFound(t *testing.T) { fstests.TestFsRmdirNotFound(t) }func TestFsMkdir(t *testing.T) { fstests.TestFsMkdir(t) }diff --git a/fstest/fstests/fstests.go b/fstest/fstests/fstests.goindex dea99276a..44453089d 100644--- a/fstest/fstests/fstests.go+++ b/fstest/fstests/fstests.go@@ -52,6 +52,7 @@ var (dumpHeaders = flag.Bool("dump-headers", false, "Dump HTTP headers - may contain sensitive info")dumpBodies = flag.Bool("dump-bodies", false, "Dump HTTP headers and bodies - may contain sensitive info")overrideRemote = flag.String("remote", "", "Set this to override the default remote name (eg s3:)")+ isLocalRemote bool)// ExtraConfigItem describes a config item added on the fly while testing@@ -88,6 +89,7 @@ func TestInit(t *testing.T) {if RemoteName == "" {RemoteName, err = fstest.LocalRemote()require.NoError(t, err)+ isLocalRemote = true}subRemoteName, subRemoteLeaf, err = fstest.RandomRemoteName(RemoteName)require.NoError(t, err)@@ -125,7 +127,29 @@ func skipIfNotListR(t *testing.T) func() {func TestFsString(t *testing.T) {skipIfNotOk(t)str := remote.String()- require.NotEqual(t, str, "")+ require.NotEqual(t, "", str)+}++// TestFsName tests the Name method+func TestFsName(t *testing.T) {+ skipIfNotOk(t)+ got := remote.Name()+ want := RemoteName+ if isLocalRemote {+ want = "local:"+ }+ require.Equal(t, want, got+":")+}++// TestFsRoot tests the Root method+func TestFsRoot(t *testing.T) {+ skipIfNotOk(t)+ name := remote.Name() + ":"+ root := remote.Root()+ if isLocalRemote {+ name = ""+ }+ require.Equal(t, subRemoteName, name+root)}// TestFsRmdirEmpty tests deleting an empty directorydiff --git a/ftp/ftp_test.go b/ftp/ftp_test.goindex b3e62e023..e09b67f13 100644--- a/ftp/ftp_test.go+++ b/ftp/ftp_test.go@@ -20,6 +20,8 @@ func TestSetup(t *testing.T) {// Generic tests for the Fsfunc TestInit(t *testing.T) { fstests.TestInit(t) }func TestFsString(t *testing.T) { fstests.TestFsString(t) }+func TestFsName(t *testing.T) { fstests.TestFsName(t) }+func TestFsRoot(t *testing.T) { fstests.TestFsRoot(t) }func TestFsRmdirEmpty(t *testing.T) { fstests.TestFsRmdirEmpty(t) }func TestFsRmdirNotFound(t *testing.T) { fstests.TestFsRmdirNotFound(t) }func TestFsMkdir(t *testing.T) { fstests.TestFsMkdir(t) }diff --git a/googlecloudstorage/googlecloudstorage_test.go b/googlecloudstorage/googlecloudstorage_test.goindex 57e18b062..1a3b8f21c 100644--- a/googlecloudstorage/googlecloudstorage_test.go+++ b/googlecloudstorage/googlecloudstorage_test.go@@ -20,6 +20,8 @@ func TestSetup(t *testing.T) {// Generic tests for the Fsfunc TestInit(t *testing.T) { fstests.TestInit(t) }func TestFsString(t *testing.T) { fstests.TestFsString(t) }+func TestFsName(t *testing.T) { fstests.TestFsName(t) }+func TestFsRoot(t *testing.T) { fstests.TestFsRoot(t) }func TestFsRmdirEmpty(t *testing.T) { fstests.TestFsRmdirEmpty(t) }func TestFsRmdirNotFound(t *testing.T) { fstests.TestFsRmdirNotFound(t) }func TestFsMkdir(t *testing.T) { fstests.TestFsMkdir(t) }diff --git a/hubic/hubic_test.go b/hubic/hubic_test.goindex a20e76920..acb65b52a 100644--- a/hubic/hubic_test.go+++ b/hubic/hubic_test.go@@ -20,6 +20,8 @@ func TestSetup(t *testing.T) {// Generic tests for the Fsfunc TestInit(t *testing.T) { fstests.TestInit(t) }func TestFsString(t *testing.T) { fstests.TestFsString(t) }+func TestFsName(t *testing.T) { fstests.TestFsName(t) }+func TestFsRoot(t *testing.T) { fstests.TestFsRoot(t) }func TestFsRmdirEmpty(t *testing.T) { fstests.TestFsRmdirEmpty(t) }func TestFsRmdirNotFound(t *testing.T) { fstests.TestFsRmdirNotFound(t) }func TestFsMkdir(t *testing.T) { fstests.TestFsMkdir(t) }diff --git a/local/local_test.go b/local/local_test.goindex b14acb473..d67b5072b 100644--- a/local/local_test.go+++ b/local/local_test.go@@ -20,6 +20,8 @@ func TestSetup(t *testing.T) {// Generic tests for the Fsfunc TestInit(t *testing.T) { fstests.TestInit(t) }func TestFsString(t *testing.T) { fstests.TestFsString(t) }+func TestFsName(t *testing.T) { fstests.TestFsName(t) }+func TestFsRoot(t *testing.T) { fstests.TestFsRoot(t) }func TestFsRmdirEmpty(t *testing.T) { fstests.TestFsRmdirEmpty(t) }func TestFsRmdirNotFound(t *testing.T) { fstests.TestFsRmdirNotFound(t) }func TestFsMkdir(t *testing.T) { fstests.TestFsMkdir(t) }diff --git a/onedrive/onedrive_test.go b/onedrive/onedrive_test.goindex ff1e504ab..d0a6c7187 100644--- a/onedrive/onedrive_test.go+++ b/onedrive/onedrive_test.go@@ -20,6 +20,8 @@ func TestSetup(t *testing.T) {// Generic tests for the Fsfunc TestInit(t *testing.T) { fstests.TestInit(t) }func TestFsString(t *testing.T) { fstests.TestFsString(t) }+func TestFsName(t *testing.T) { fstests.TestFsName(t) }+func TestFsRoot(t *testing.T) { fstests.TestFsRoot(t) }func TestFsRmdirEmpty(t *testing.T) { fstests.TestFsRmdirEmpty(t) }func TestFsRmdirNotFound(t *testing.T) { fstests.TestFsRmdirNotFound(t) }func TestFsMkdir(t *testing.T) { fstests.TestFsMkdir(t) }diff --git a/s3/s3_test.go b/s3/s3_test.goindex 45ea9d6d8..1918322a4 100644--- a/s3/s3_test.go+++ b/s3/s3_test.go@@ -20,6 +20,8 @@ func TestSetup(t *testing.T) {// Generic tests for the Fsfunc TestInit(t *testing.T) { fstests.TestInit(t) }func TestFsString(t *testing.T) { fstests.TestFsString(t) }+func TestFsName(t *testing.T) { fstests.TestFsName(t) }+func TestFsRoot(t *testing.T) { fstests.TestFsRoot(t) }func TestFsRmdirEmpty(t *testing.T) { fstests.TestFsRmdirEmpty(t) }func TestFsRmdirNotFound(t *testing.T) { fstests.TestFsRmdirNotFound(t) }func TestFsMkdir(t *testing.T) { fstests.TestFsMkdir(t) }diff --git a/sftp/sftp_test.go b/sftp/sftp_test.goindex 8e81a6b75..360b48ff8 100644--- a/sftp/sftp_test.go+++ b/sftp/sftp_test.go@@ -20,6 +20,8 @@ func TestSetup(t *testing.T) {// Generic tests for the Fsfunc TestInit(t *testing.T) { fstests.TestInit(t) }func TestFsString(t *testing.T) { fstests.TestFsString(t) }+func TestFsName(t *testing.T) { fstests.TestFsName(t) }+func TestFsRoot(t *testing.T) { fstests.TestFsRoot(t) }func TestFsRmdirEmpty(t *testing.T) { fstests.TestFsRmdirEmpty(t) }func TestFsRmdirNotFound(t *testing.T) { fstests.TestFsRmdirNotFound(t) }func TestFsMkdir(t *testing.T) { fstests.TestFsMkdir(t) }diff --git a/swift/swift_test.go b/swift/swift_test.goindex 1190a0f14..6e7370402 100644--- a/swift/swift_test.go+++ b/swift/swift_test.go@@ -20,6 +20,8 @@ func TestSetup(t *testing.T) {// Generic tests for the Fsfunc TestInit(t *testing.T) { fstests.TestInit(t) }func TestFsString(t *testing.T) { fstests.TestFsString(t) }+func TestFsName(t *testing.T) { fstests.TestFsName(t) }+func TestFsRoot(t *testing.T) { fstests.TestFsRoot(t) }func TestFsRmdirEmpty(t *testing.T) { fstests.TestFsRmdirEmpty(t) }func TestFsRmdirNotFound(t *testing.T) { fstests.TestFsRmdirNotFound(t) }func TestFsMkdir(t *testing.T) { fstests.TestFsMkdir(t) }diff --git a/yandex/yandex.go b/yandex/yandex.goindex f71a480c6..b923e031f 100644--- a/yandex/yandex.go+++ b/yandex/yandex.go@@ -130,7 +130,8 @@ func NewFs(name, root string) (fs.Fs, error) {yandexDisk := yandex.NewClient(token.AccessToken, fs.Config.Client())f := &Fs{- yd: yandexDisk,+ name: name,+ yd: yandexDisk,}f.features = (&fs.Features{ReadMimeType: true, WriteMimeType: true}).Fill(f)f.setRoot(root)diff --git a/yandex/yandex_test.go b/yandex/yandex_test.goindex 683f48dd3..34189e908 100644--- a/yandex/yandex_test.go+++ b/yandex/yandex_test.go@@ -20,6 +20,8 @@ func TestSetup(t *testing.T) {// Generic tests for the Fsfunc TestInit(t *testing.T) { fstests.TestInit(t) }func TestFsString(t *testing.T) { fstests.TestFsString(t) }+func TestFsName(t *testing.T) { fstests.TestFsName(t) }+func TestFsRoot(t *testing.T) { fstests.TestFsRoot(t) }func TestFsRmdirEmpty(t *testing.T) { fstests.TestFsRmdirEmpty(t) }func TestFsRmdirNotFound(t *testing.T) { fstests.TestFsRmdirNotFound(t) }func TestFsMkdir(t *testing.T) { fstests.TestFsMkdir(t) }