62 lines · 1.9 KB · Go
RawDownload
// Test Crypt filesystem interfacepackage crypt_test import (	"os"	"path/filepath"	"testing" 	"github.com/ncw/rclone/backend/crypt"	_ "github.com/ncw/rclone/backend/local"	"github.com/ncw/rclone/fs/config/obscure"	"github.com/ncw/rclone/fstest/fstests") // TestStandard runs integration tests against the remotefunc TestStandard(t *testing.T) {	tempdir := filepath.Join(os.TempDir(), "rclone-crypt-test-standard")	name := "TestCrypt"	fstests.Run(t, &fstests.Opt{		RemoteName: name + ":",		NilObject:  (*crypt.Object)(nil),		ExtraConfig: []fstests.ExtraConfigItem{			{Name: name, Key: "type", Value: "crypt"},			{Name: name, Key: "remote", Value: tempdir},			{Name: name, Key: "password", Value: obscure.MustObscure("potato")},			{Name: name, Key: "filename_encryption", Value: "standard"},		},	})} // TestOff runs integration tests against the remotefunc TestOff(t *testing.T) {	tempdir := filepath.Join(os.TempDir(), "rclone-crypt-test-off")	name := "TestCrypt2"	fstests.Run(t, &fstests.Opt{		RemoteName: name + ":",		NilObject:  (*crypt.Object)(nil),		ExtraConfig: []fstests.ExtraConfigItem{			{Name: name, Key: "type", Value: "crypt"},			{Name: name, Key: "remote", Value: tempdir},			{Name: name, Key: "password", Value: obscure.MustObscure("potato2")},			{Name: name, Key: "filename_encryption", Value: "off"},		},	})} // TestObfuscate runs integration tests against the remotefunc TestObfuscate(t *testing.T) {	tempdir := filepath.Join(os.TempDir(), "rclone-crypt-test-obfuscate")	name := "TestCrypt3"	fstests.Run(t, &fstests.Opt{		RemoteName: name + ":",		NilObject:  (*crypt.Object)(nil),		ExtraConfig: []fstests.ExtraConfigItem{			{Name: name, Key: "type", Value: "crypt"},			{Name: name, Key: "remote", Value: tempdir},			{Name: name, Key: "password", Value: obscure.MustObscure("potato2")},			{Name: name, Key: "filename_encryption", Value: "obfuscate"},		},		SkipBadWindowsCharacters: true,	})}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t