all: replace t.Log(); t.FailNow() with t.Fatal() (#19849)
This commit is contained in:
committed by
Péter Szilágyi
parent
9466b9eec5
commit
f088c650a5
@ -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")
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user