Merge pull request #2135 from nspcc-dev/fix-test
cli: fix tests for go1.17
This commit is contained in:
commit
1a733ca456
1 changed files with 7 additions and 6 deletions
|
@ -3,6 +3,7 @@ package server
|
||||||
import (
|
import (
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
|
"path"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
@ -15,15 +16,15 @@ func TestGetPath(t *testing.T) {
|
||||||
err := os.RemoveAll(testPath)
|
err := os.RemoveAll(testPath)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
})
|
})
|
||||||
path, err := getPath(testPath, 123)
|
actual, err := getPath(testPath, 123)
|
||||||
require.NoError(t, err)
|
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.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.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