tor: use T.TempDir to create temporary test directory
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
This commit is contained in:
1 file changed
+1
-5
@@ -3,7 +3,6 @@ package tor
|
|||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"errors"
|
"errors"
|
||||||
"io/ioutil"
|
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
@@ -16,11 +15,8 @@ import (
|
|||||||
func TestOnionFile(t *testing.T) {
|
func TestOnionFile(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
|
|
||||||
tempDir, err := ioutil.TempDir("", "onion_store")
|
|
||||||
require.NoError(t, err, "unable to create temp dir")
|
|
||||||
|
|
||||||
privateKey := []byte("hide_me_plz")
|
privateKey := []byte("hide_me_plz")
|
||||||
privateKeyPath := filepath.Join(tempDir, "secret")
|
privateKeyPath := filepath.Join(t.TempDir(), "secret")
|
||||||
|
|
||||||
// Create a new file-based onion store. A private key should not exist
|
// Create a new file-based onion store. A private key should not exist
|
||||||
// yet.
|
// yet.
|
||||||
|
|||||||
Reference in new issue
Block a user