Merge pull request #2135 from nspcc-dev/fix-test

cli: fix tests for go1.17
This commit is contained in:
Roman Khimov 2021-08-20 16:48:22 +03:00 committed by GitHub
commit 1a733ca456
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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