Add fakes for db interface (#46885)

This commit is contained in:
idafurjes
2022-03-23 15:06:47 +01:00
committed by GitHub
parent 72b6f64df9
commit 77976ea810

View File

@@ -0,0 +1,23 @@
package dbtest
import (
"context"
"github.com/grafana/grafana/pkg/services/sqlstore"
)
type FakeDB struct {
ExpectedError error
}
func NewFakeDB() *FakeDB {
return &FakeDB{}
}
func (f *FakeDB) WithTransactionalDbSession(ctx context.Context, callback sqlstore.DBTransactionFunc) error {
return f.ExpectedError
}
func (f *FakeDB) WithDbSession(ctx context.Context, callback sqlstore.DBTransactionFunc) error {
return f.ExpectedError
}