mirror of
https://github.com/diamondburned/arikawa.git
synced 2025-01-07 12:38:05 +00:00
Gateway: Add URL test
This commit is contained in:
parent
2dadb0701d
commit
c9a7ec8122
|
@ -21,6 +21,21 @@ func init() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestURL(t *testing.T) {
|
||||||
|
u, err := URL()
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal("failed to get gateway URL:", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if u == "" {
|
||||||
|
t.Fatal("gateway URL is empty")
|
||||||
|
}
|
||||||
|
|
||||||
|
if !strings.HasPrefix(u, "wss://") {
|
||||||
|
t.Fatal("gatewayURL is invalid:", u)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func TestInvalidToken(t *testing.T) {
|
func TestInvalidToken(t *testing.T) {
|
||||||
g, err := NewGateway("bad token")
|
g, err := NewGateway("bad token")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in a new issue