[#1959] neofs-adm: Remove newTempDir function

Signed-off-by: Evgenii Stratonikov <evgeniy@morphbits.ru>
This commit is contained in:
Evgenii Stratonikov 2022-10-24 15:45:13 +03:00 committed by fyrchik
parent 2404a267b9
commit 7c3ac7150d
2 changed files with 2 additions and 11 deletions

View file

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

View file

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