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

@@ -399,7 +399,7 @@ func TestQueryPayments(t *testing.T) {
t.Run(tt.name, func(t *testing.T) {
t.Parallel()
db, cleanup, err := makeTestDB()
db, cleanup, err := MakeTestDB()
if err != nil {
t.Fatalf("unable to init db: %v", err)
}
@@ -512,7 +512,7 @@ func TestQueryPayments(t *testing.T) {
// case where a specific duplicate is not found and the duplicates bucket is not
// present when we expect it to be.
func TestFetchPaymentWithSequenceNumber(t *testing.T) {
db, cleanup, err := makeTestDB()
db, cleanup, err := MakeTestDB()
require.NoError(t, err)
defer cleanup()