Commits

Miki Tebeka  committed edf003a

user & host in test dir

  • Participants
  • Parent commits e944db4
  • Branches gomain

Comments (0)

Files changed (1)

File nrsc_test.go

 )
 
 const (
-	root = "/tmp/nrsc-test"
 	port = 9888
 )
 
+var root string
+
+func init() {
+	root = testDir()
+}
+
+func testDir() string {
+	host, err := os.Hostname()
+	if err != nil {
+		host = "localhost"
+	}
+	return fmt.Sprintf("%s/nrsc-test-%s-%s", os.TempDir(), os.Getenv("USER"), host)
+}
+
 func TestMask(t *testing.T) {
 	resp := getResp(t, "/static/i.gif")
 	if resp.StatusCode != http.StatusUnauthorized {