forked from TrueCloudLab/neoneo-go
cli: fix tests for go1.17
`getPath` returns paths without leading dot. Signed-off-by: Evgeniy Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
parent
483934d3a6
commit
0b681d40e8
1 changed files with 7 additions and 6 deletions
|
@ -3,6 +3,7 @@ package server
|
|||
import (
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
|
@ -15,15 +16,15 @@ func TestGetPath(t *testing.T) {
|
|||
err := os.RemoveAll(testPath)
|
||||
require.NoError(t, err)
|
||||
})
|
||||
path, err := getPath(testPath, 123)
|
||||
actual, err := getPath(testPath, 123)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, testPath+"/BlockStorage_100000/dump-block-1000.json", path)
|
||||
require.Equal(t, path.Join(testPath, "/BlockStorage_100000/dump-block-1000.json"), actual)
|
||||
|
||||
path, err = getPath(testPath, 1230)
|
||||
actual, err = getPath(testPath, 1230)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, testPath+"/BlockStorage_100000/dump-block-2000.json", path)
|
||||
require.Equal(t, path.Join(testPath, "/BlockStorage_100000/dump-block-2000.json"), actual)
|
||||
|
||||
path, err = getPath(testPath, 123000)
|
||||
actual, err = getPath(testPath, 123000)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, testPath+"/BlockStorage_200000/dump-block-123000.json", path)
|
||||
require.Equal(t, path.Join(testPath, "/BlockStorage_200000/dump-block-123000.json"), actual)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue