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