mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-05 17:22:18 +00:00
19 lines
324 B
Go
19 lines
324 B
Go
|
package db
|
||
|
|
||
|
import (
|
||
|
"os"
|
||
|
"path/filepath"
|
||
|
"testing"
|
||
|
)
|
||
|
|
||
|
func TestClearDB(t *testing.T) {
|
||
|
db := SetupDB(t, [][48]byte{})
|
||
|
if err := db.ClearDB(); err != nil {
|
||
|
t.Fatal(err)
|
||
|
}
|
||
|
|
||
|
if _, err := os.Stat(filepath.Join(db.DatabasePath(), databaseFileName)); !os.IsNotExist(err) {
|
||
|
t.Fatalf("DB was not cleared: %v", err)
|
||
|
}
|
||
|
}
|