Switch using user home to a tmp directory
This commit is contained in:
parent
0efa89ff2d
commit
640bccf8f7
|
@ -3,9 +3,7 @@ package clitest
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
|
||||||
"os"
|
"os"
|
||||||
"os/user"
|
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
@ -176,13 +174,9 @@ func TestGaiaCLISubmitProposal(t *testing.T) {
|
||||||
// helper methods
|
// helper methods
|
||||||
|
|
||||||
func getTestingHomeDirs() (string, string) {
|
func getTestingHomeDirs() (string, string) {
|
||||||
usr, err := user.Current()
|
tmpDir := os.TempDir()
|
||||||
if err != nil {
|
gaiadHome := fmt.Sprintf("%s%s.test_gaiad", tmpDir, string(os.PathSeparator))
|
||||||
log.Fatal(err)
|
gaiacliHome := fmt.Sprintf("%s%s.test_gaiacli", tmpDir, string(os.PathSeparator))
|
||||||
}
|
|
||||||
home := usr.HomeDir
|
|
||||||
gaiadHome := fmt.Sprintf("%s%s.test_gaiad", home, string(os.PathSeparator))
|
|
||||||
gaiacliHome := fmt.Sprintf("%s%s.test_gaiacli", home, string(os.PathSeparator))
|
|
||||||
return gaiadHome, gaiacliHome
|
return gaiadHome, gaiacliHome
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue