mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-05-09 13:13:13 +00:00
*: make tests use TempDir(), fix #1319
Simplify things, drop TempFile at the same time (refs. #1764)
This commit is contained in:
parent
f4ba21a41a
commit
6d074a96e9
16 changed files with 93 additions and 308 deletions
|
@ -1,8 +1,6 @@
|
|||
package server
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path"
|
||||
"testing"
|
||||
|
||||
|
@ -10,12 +8,7 @@ import (
|
|||
)
|
||||
|
||||
func TestGetPath(t *testing.T) {
|
||||
testPath, err := ioutil.TempDir("./", "")
|
||||
require.NoError(t, err)
|
||||
t.Cleanup(func() {
|
||||
err := os.RemoveAll(testPath)
|
||||
require.NoError(t, err)
|
||||
})
|
||||
testPath := t.TempDir()
|
||||
actual, err := getPath(testPath, 123)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, path.Join(testPath, "/BlockStorage_100000/dump-block-1000.json"), actual)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue