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
2020-06-24 12:50:11 +02:00
parent 63e9d6102f
commit cbce8e8872
13 changed files with 113 additions and 114 deletions

View File

@@ -13,7 +13,7 @@ import (
func TestLinkNodeEncodeDecode(t *testing.T) {
t.Parallel()
cdb, cleanUp, err := makeTestDB()
cdb, cleanUp, err := MakeTestDB()
if err != nil {
t.Fatalf("unable to make test database: %v", err)
}
@@ -110,7 +110,7 @@ func TestLinkNodeEncodeDecode(t *testing.T) {
func TestDeleteLinkNode(t *testing.T) {
t.Parallel()
cdb, cleanUp, err := makeTestDB()
cdb, cleanUp, err := MakeTestDB()
if err != nil {
t.Fatalf("unable to make test database: %v", err)
}