channeldb: move makeTestDB out of test to make it available for other tests

This commit moves makeTestDB to db.go and exports it so that we'll be
able to use this function in other unit tests to make them testable with
etcd if needed.
This commit is contained in:
Andras Banki-Horvath committed 2020-07-28 17:57:29 +02:00
1 parent 63e9d6102f
commit cbce8e8872
13 files changed
+113 -114

No files matched your search

+3 -3
View File
@@ -19,7 +19,7 @@ func TestForwardingLogBasicStorageAndQuery(t *testing.T) {
// First, we'll set up a test database, and use that to instantiate the
// forwarding event log that we'll be using for the duration of the
// test.
db, cleanUp, err := makeTestDB()
db, cleanUp, err := MakeTestDB()
defer cleanUp()
if err != nil {
t.Fatalf("unable to make test db: %v", err)
@@ -91,7 +91,7 @@ func TestForwardingLogQueryOptions(t *testing.T) {
// First, we'll set up a test database, and use that to instantiate the
// forwarding event log that we'll be using for the duration of the
// test.
db, cleanUp, err := makeTestDB()
db, cleanUp, err := MakeTestDB()
defer cleanUp()
if err != nil {
t.Fatalf("unable to make test db: %v", err)
@@ -196,7 +196,7 @@ func TestForwardingLogQueryLimit(t *testing.T) {
// First, we'll set up a test database, and use that to instantiate the
// forwarding event log that we'll be using for the duration of the
// test.
db, cleanUp, err := makeTestDB()
db, cleanUp, err := MakeTestDB()
defer cleanUp()
if err != nil {
t.Fatalf("unable to make test db: %v", err)