2020-05-15 16:59:37 +02:00
|
|
|
// +build kvdb_etcd
|
|
|
|
|
2020-02-18 19:35:53 +01:00
|
|
|
package etcd
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/btcsuite/btcwallet/walletdb"
|
2020-06-29 14:53:38 +02:00
|
|
|
"github.com/stretchr/testify/require"
|
2020-02-18 19:35:53 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestOpenCreateFailure(t *testing.T) {
|
|
|
|
t.Parallel()
|
|
|
|
|
|
|
|
db, err := walletdb.Open(dbType)
|
2020-06-29 14:53:38 +02:00
|
|
|
require.Error(t, err)
|
|
|
|
require.Nil(t, db)
|
2020-02-18 19:35:53 +01:00
|
|
|
|
|
|
|
db, err = walletdb.Open(dbType, "wrong")
|
2020-06-29 14:53:38 +02:00
|
|
|
require.Error(t, err)
|
|
|
|
require.Nil(t, db)
|
2020-02-18 19:35:53 +01:00
|
|
|
|
|
|
|
db, err = walletdb.Create(dbType)
|
2020-06-29 14:53:38 +02:00
|
|
|
require.Error(t, err)
|
|
|
|
require.Nil(t, db)
|
2020-02-18 19:35:53 +01:00
|
|
|
|
|
|
|
db, err = walletdb.Create(dbType, "wrong")
|
2020-06-29 14:53:38 +02:00
|
|
|
require.Error(t, err)
|
|
|
|
require.Nil(t, db)
|
2020-02-18 19:35:53 +01:00
|
|
|
}
|