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:
Evgeniy Stratonikov 2021-08-19 18:16:55 +03:00
parent 483934d3a6
commit 0b681d40e8

View file

@ -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)
}