version: fix test under Windows

This commit is contained in:
Nick Craig-Wood 2018-08-28 16:07:36 +01:00
parent 84ef6b2ae6
commit 5c75453aba

View File

@ -4,6 +4,7 @@ import (
"fmt"
"io/ioutil"
"os"
"runtime"
"testing"
"github.com/ncw/rclone/cmd"
@ -21,7 +22,9 @@ func TestVersionWorksWithoutAccessibleConfigFile(t *testing.T) {
assert.NoError(t, err)
}()
assert.NoError(t, tempFile.Close())
assert.NoError(t, os.Chmod(path, 0000))
if runtime.GOOS != "windows" {
assert.NoError(t, os.Chmod(path, 0000))
}
// re-wire
oldOsStdout := os.Stdout
oldConfigPath := config.ConfigPath