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"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestOpenCreateFailure(t *testing.T) {
|
|
|
|
t.Parallel()
|
|
|
|
|
|
|
|
db, err := walletdb.Open(dbType)
|
|
|
|
assert.Error(t, err)
|
|
|
|
assert.Nil(t, db)
|
|
|
|
|
|
|
|
db, err = walletdb.Open(dbType, "wrong")
|
|
|
|
assert.Error(t, err)
|
|
|
|
assert.Nil(t, db)
|
|
|
|
|
|
|
|
db, err = walletdb.Create(dbType)
|
|
|
|
assert.Error(t, err)
|
|
|
|
assert.Nil(t, db)
|
|
|
|
|
|
|
|
db, err = walletdb.Create(dbType, "wrong")
|
|
|
|
assert.Error(t, err)
|
|
|
|
assert.Nil(t, db)
|
|
|
|
}
|