[#1959] neofs-adm: Remove newTempDir
function
Signed-off-by: Evgenii Stratonikov <evgeniy@morphbits.ru>
This commit is contained in:
parent
2404a267b9
commit
7c3ac7150d
2 changed files with 2 additions and 11 deletions
|
@ -24,7 +24,7 @@ const testContractPassword = "grouppass"
|
||||||
func TestGenerateAlphabet(t *testing.T) {
|
func TestGenerateAlphabet(t *testing.T) {
|
||||||
const size = 4
|
const size = 4
|
||||||
|
|
||||||
walletDir := newTempDir(t)
|
walletDir := t.TempDir()
|
||||||
buf := setupTestTerminal(t)
|
buf := setupTestTerminal(t)
|
||||||
|
|
||||||
cmd := generateAlphabetCmd
|
cmd := generateAlphabetCmd
|
||||||
|
@ -110,12 +110,3 @@ func setupTestTerminal(t *testing.T) *bytes.Buffer {
|
||||||
|
|
||||||
return in
|
return in
|
||||||
}
|
}
|
||||||
|
|
||||||
func newTempDir(t *testing.T) string {
|
|
||||||
dir := filepath.Join(t.TempDir(), "neofs-adm.test."+strconv.FormatUint(rand.Uint64(), 10))
|
|
||||||
require.NoError(t, os.Mkdir(dir, os.ModePerm))
|
|
||||||
t.Cleanup(func() {
|
|
||||||
require.NoError(t, os.RemoveAll(dir))
|
|
||||||
})
|
|
||||||
return dir
|
|
||||||
}
|
|
||||||
|
|
|
@ -35,7 +35,7 @@ func TestInitialize(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func testInitialize(t *testing.T, committeeSize int) {
|
func testInitialize(t *testing.T, committeeSize int) {
|
||||||
testdataDir := newTempDir(t)
|
testdataDir := t.TempDir()
|
||||||
v := viper.GetViper()
|
v := viper.GetViper()
|
||||||
|
|
||||||
generateTestData(t, testdataDir, committeeSize)
|
generateTestData(t, testdataDir, committeeSize)
|
||||||
|
|
Loading…
Reference in a new issue