63
64
// SetupSuiteBase sets up the test suite
65
>
func (tb *DBTestBase) SetupSuiteBase(db DB) {
dbtest.go
66
>
tb.Assertions = require.New(tb.T()) // Have to define our overridden assertions in the test setup. If we did it earlier, tb.T() will return nil
67
>
tb.Log = log.NewTestLogger()
68
>
rand := rand.New(rand.NewSource(time.Now().UnixNano()))
69
>
tb.DBName = fmt.Sprintf("db_client_test_%v", rand.Int63())
70
>
err := db.CreateDatabase(tb.DBName)
71
>
if err != nil {
72
tb.Log.Fatal("error creating database, ", tag.Error(err))
73
}
75
}
76
77
// TearDownSuiteBase tears down the test suite
78
>
func (tb *DBTestBase) TearDownSuiteBase() {
dbtest.go
79
>
tb.NoError(tb.db.DropDatabase(tb.DBName))
80
>
tb.db.Close()
81
>
}
82
83
// RunParseFileTest runs a test against the ParseFile method