Add -dump-headers and -dump-bodies flags for remote tests

This commit is contained in:
Nick Craig-Wood 2015-11-07 09:48:46 +00:00
parent 8f2999b6af
commit 6d48dffa2f

View file

@ -38,6 +38,8 @@ var (
Path: `hello? sausage/êé/Hello, 世界/ " ' @ < > & ?/z.txt`, Path: `hello? sausage/êé/Hello, 世界/ " ' @ < > & ?/z.txt`,
WinPath: `hello_ sausage/êé/Hello, 世界/ _ ' @ _ _ & _/z.txt`, WinPath: `hello_ sausage/êé/Hello, 世界/ _ ' @ _ _ & _/z.txt`,
} }
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")
) )
func init() { func init() {
@ -50,6 +52,8 @@ func TestInit(t *testing.T) {
fs.LoadConfig() fs.LoadConfig()
fs.Config.Verbose = false fs.Config.Verbose = false
fs.Config.Quiet = true fs.Config.Quiet = true
fs.Config.DumpHeaders = *dumpHeaders
fs.Config.DumpBodies = *dumpBodies
t.Logf("Using remote %q", RemoteName) t.Logf("Using remote %q", RemoteName)
if RemoteName == "" { if RemoteName == "" {
RemoteName, err = fstest.LocalRemote() RemoteName, err = fstest.LocalRemote()