Skip to content

Commit

Permalink
GetTempDir -> NewTestCaseDir
Browse files Browse the repository at this point in the history
  • Loading branch information
Alessio Treglia committed Feb 8, 2019
1 parent a4e3eac commit 5cb21f1
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 12 deletions.
3 changes: 1 addition & 2 deletions client/keys/add_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ func Test_runAddCmdBasic(t *testing.T) {
assert.EqualError(t, err, "EOF")

// Prepare a keybase
kbHome, kbCleanUp, err := tests.GetTempDir("Test_runDeleteCmd")
assert.NoError(t, err)
kbHome, kbCleanUp := tests.NewTestCaseDir(t)
assert.NotNil(t, kbHome)
defer kbCleanUp()
viper.Set(cli.HomeFlag, kbHome)
Expand Down
3 changes: 1 addition & 2 deletions client/keys/delete_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ func Test_runDeleteCmd(t *testing.T) {
fakeKeyName2 := "runDeleteCmd_Key2"

// Now add a temporary keybase
kbHome, cleanUp, err := tests.GetTempDir("Test_runDeleteCmd")
assert.NoError(t, err)
kbHome, cleanUp := tests.NewTestCaseDir(t)
defer cleanUp()
viper.Set(cli.HomeFlag, kbHome)

Expand Down
6 changes: 2 additions & 4 deletions client/keys/list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,13 @@ func Test_runListCmd(t *testing.T) {
cmdBasic := listKeysCmd()

// Prepare some keybases
kbHome1, cleanUp1, err := tests.GetTempDir("Test_runListCmd")
kbHome1, cleanUp1 := tests.NewTestCaseDir(t)
defer cleanUp1()
assert.NoError(t, err)
// Do nothing, leave home1 empty

kbHome2, cleanUp2, err := tests.GetTempDir("Test_runListCmd")
kbHome2, cleanUp2 := tests.NewTestCaseDir(t)
defer cleanUp2()
viper.Set(cli.HomeFlag, kbHome2)
assert.NoError(t, err)

kb, err := NewKeyBaseFromHomeFlag()
assert.NoError(t, err)
Expand Down
3 changes: 1 addition & 2 deletions client/keys/show_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ func Test_runShowCmd(t *testing.T) {

// Prepare a key base
// Now add a temporary keybase
kbHome, cleanUp, err := tests.GetTempDir("Test_runShowCmd")
assert.NoError(t, err)
kbHome, cleanUp := tests.NewTestCaseDir(t)
defer cleanUp()
viper.Set(cli.HomeFlag, kbHome)

Expand Down
3 changes: 1 addition & 2 deletions client/keys/update_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ func Test_runUpdateCmd(t *testing.T) {

// Prepare a key base
// Now add a temporary keybase
kbHome, cleanUp1, err := tests.GetTempDir("Test_runShowCmd")
assert.NoError(t, err)
kbHome, cleanUp1 := tests.NewTestCaseDir(t)
defer cleanUp1()
viper.Set(cli.HomeFlag, kbHome)

Expand Down

0 comments on commit 5cb21f1

Please sign in to comment.