mirror of
https://github.com/rclone/rclone.git
synced 2024-12-23 07:29:35 +01:00
testing: add -remote flag to allow unit tests to run on other remotes
Use this on the individual fs unit tests, eg cd s3 go run -v -remote mytestS3:
This commit is contained in:
parent
e320f4a988
commit
40b3c4883f
@ -5,6 +5,7 @@ import (
|
||||
"bytes"
|
||||
"crypto/md5"
|
||||
"encoding/hex"
|
||||
"flag"
|
||||
"io"
|
||||
"log"
|
||||
"os"
|
||||
@ -32,11 +33,16 @@ var (
|
||||
}
|
||||
)
|
||||
|
||||
func init() {
|
||||
flag.StringVar(&RemoteName, "remote", "", "Set this to override the default remote name (eg s3:)")
|
||||
}
|
||||
|
||||
func TestInit(t *testing.T) {
|
||||
var err error
|
||||
fs.LoadConfig()
|
||||
fs.Config.Verbose = false
|
||||
fs.Config.Quiet = true
|
||||
t.Logf("Using remote %q", RemoteName)
|
||||
if RemoteName == "" {
|
||||
RemoteName, err = fstest.LocalRemote()
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user