prysm-pulse/slasher/db/testing/setup_db_test.go

19 lines
336 B
Go
Raw Normal View History

package testing
2019-09-26 16:29:10 +00:00
import (
"os"
"testing"
)
func TestClearDB(t *testing.T) {
slasherDB := SetupSlasherDB(t, false)
2019-09-26 16:29:10 +00:00
defer TeardownSlasherDB(t, slasherDB)
if err := slasherDB.ClearDB(); err != nil {
t.Fatal(err)
}
if _, err := os.Stat(slasherDB.DatabasePath()); !os.IsNotExist(err) {
t.Fatalf("db wasnt cleared %v", err)
}
}