Replaced Connect test with test checking wrong credentials provided
package remote
-import "testing"
+import (
+ "testing"
-func TestConnect(t *testing.T) {
- btcChain, err := Connect()
- if err != nil {
- t.Fatal(err)
+ "github.com/keep-network/tbtc/relay/pkg/btc"
+)
+
+func TestConnectionWrongURL(t *testing.T) {
+ config := &btc.Config{
+ URL: "dummyURL",
+ Password: "pass",
+ Username: "user",
+ }
+
+ btcChain, err := Connect(config)
+ if err == nil {
+ t.Fatal("No error received")
}
- if btcChain == nil {
- t.Errorf("btc chain handle is null")
+ if btcChain != nil {
+ t.Errorf("Non nil btc chain received")
}
}
