aboutsummaryrefslogtreecommitdiffstats
path: root/rpc
diff options
context:
space:
mode:
Diffstat (limited to 'rpc')
-rw-r--r--rpc/websocket_test.go20
1 files changed, 6 insertions, 14 deletions
diff --git a/rpc/websocket_test.go b/rpc/websocket_test.go
index 5bf3780d6..2caede474 100644
--- a/rpc/websocket_test.go
+++ b/rpc/websocket_test.go
@@ -21,34 +21,26 @@ import "testing"
func TestWSGetConfigNoAuth(t *testing.T) {
config, err := wsGetConfig("ws://example.com:1234", "")
if err != nil {
- t.Logf("wsGetConfig failed: %s", err)
- t.Fail()
- return
+ t.Fatalf("wsGetConfig failed: %s", err)
}
if config.Location.User != nil {
- t.Log("User should have been stripped from the URL")
- t.Fail()
+ t.Fatalf("User should have been stripped from the URL")
}
if config.Location.Hostname() != "example.com" ||
config.Location.Port() != "1234" || config.Location.Scheme != "ws" {
- t.Logf("Unexpected URL: %s", config.Location)
- t.Fail()
+ t.Fatalf("Unexpected URL: %s", config.Location)
}
}
func TestWSGetConfigWithBasicAuth(t *testing.T) {
config, err := wsGetConfig("wss://testuser:test-PASS_01@example.com:1234", "")
if err != nil {
- t.Logf("wsGetConfig failed: %s", err)
- t.Fail()
- return
+ t.Fatalf("wsGetConfig failed: %s", err)
}
if config.Location.User != nil {
- t.Log("User should have been stripped from the URL")
- t.Fail()
+ t.Fatal("User should have been stripped from the URL")
}
if config.Header.Get("Authorization") != "Basic dGVzdHVzZXI6dGVzdC1QQVNTXzAx" {
- t.Log("Basic auth header is incorrect")
- t.Fail()
+ t.Fatal("Basic auth header is incorrect")
}
}