forked from TrueCloudLab/rclone
version: fix test under Windows
This commit is contained in:
parent
84ef6b2ae6
commit
5c75453aba
1 changed files with 4 additions and 1 deletions
|
@ -4,6 +4,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
|
"runtime"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/ncw/rclone/cmd"
|
"github.com/ncw/rclone/cmd"
|
||||||
|
@ -21,7 +22,9 @@ func TestVersionWorksWithoutAccessibleConfigFile(t *testing.T) {
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
}()
|
}()
|
||||||
assert.NoError(t, tempFile.Close())
|
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
|
// re-wire
|
||||||
oldOsStdout := os.Stdout
|
oldOsStdout := os.Stdout
|
||||||
oldConfigPath := config.ConfigPath
|
oldConfigPath := config.ConfigPath
|
||||||
|
|
Loading…
Reference in a new issue