|
|
@@ -9,7 +9,7 @@ import (
|
|
|
)
|
|
|
|
|
|
func TestAccountManager(t *testing.T) {
|
|
|
- ks := crypto.NewKeyStorePlain(ethutil.DefaultDataDir())
|
|
|
+ ks := crypto.NewKeyStorePlain(ethutil.DefaultDataDir() + "/testaccounts")
|
|
|
am := NewAccountManager(ks)
|
|
|
pass := "" // not used but required by API
|
|
|
a1, err := am.NewAccount(pass)
|
|
|
@@ -18,4 +18,16 @@ func TestAccountManager(t *testing.T) {
|
|
|
if err != nil {
|
|
|
t.Fatal(err)
|
|
|
}
|
|
|
+
|
|
|
+ // Cleanup
|
|
|
+ accounts, err := am.Accounts()
|
|
|
+ if err != nil {
|
|
|
+ t.Fatal(err)
|
|
|
+ }
|
|
|
+ for _, account := range accounts {
|
|
|
+ err := am.DeleteAccount(account.Address, pass)
|
|
|
+ if err != nil {
|
|
|
+ t.Fatal(err)
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|