prysm-pulse/slasher/db/testing/setup_db_test.go
Ivan Martinez 2473680759
Add spans to Slasher DB functions (#4855)
* Add interface and move slashing types to /types package

* Add spans for all DB functions

* Fix packages

* Fix func call
2020-02-13 13:51:30 -06:00

24 lines
450 B
Go

package testing
import (
"flag"
"os"
"testing"
"github.com/urfave/cli"
)
func TestClearDB(t *testing.T) {
app := cli.NewApp()
set := flag.NewFlagSet("test", 0)
slasherDB := SetupSlasherDB(t, cli.NewContext(app, set, nil))
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)
}
}