mirror of
https://github.com/diamondburned/arikawa.git
synced 2024-11-19 21:32:49 +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) {
|
||||
g, err := NewGateway("bad token")
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in a new issue