mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-12-25 23:43:49 +00:00
6d074a96e9
Simplify things, drop TempFile at the same time (refs. #1764)
23 lines
621 B
Go
23 lines
621 B
Go
package server
|
|
|
|
import (
|
|
"path"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestGetPath(t *testing.T) {
|
|
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)
|
|
|
|
actual, err = getPath(testPath, 1230)
|
|
require.NoError(t, err)
|
|
require.Equal(t, path.Join(testPath, "/BlockStorage_100000/dump-block-2000.json"), actual)
|
|
|
|
actual, err = getPath(testPath, 123000)
|
|
require.NoError(t, err)
|
|
require.Equal(t, path.Join(testPath, "/BlockStorage_200000/dump-block-123000.json"), actual)
|
|
}
|