This repository has been archived by the owner on Feb 9, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathendpoints_test.go
35 lines (32 loc) · 1.74 KB
/
endpoints_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package dhelpers
import (
"testing"
"github.com/bwmarrin/discordgo"
)
func TestSetDiscordEndpoints(t *testing.T) {
SetDiscordEndpoints("https://example.org/")
if discordgo.EndpointDiscord != "https://example.org/" {
t.Error("Expected https://example.org/, got ", discordgo.EndpointDiscord)
}
if discordgo.EndpointAPI != "https://example.org/"+"api/v"+discordgo.APIVersion+"/" {
t.Error("Expected https://example.org/"+"api/v"+discordgo.APIVersion+"/, got ", discordgo.EndpointDiscord)
}
if discordgo.EndpointGuilds != "https://example.org/api/v"+discordgo.APIVersion+"/guilds/" {
t.Error("Expected https://example.org/api/v"+discordgo.APIVersion+"/guilds/, got ", discordgo.EndpointDiscord)
}
if discordgo.EndpointChannels != "https://example.org/api/v"+discordgo.APIVersion+"/channels/" {
t.Error("Expected https://example.org/api/v"+discordgo.APIVersion+"/channels/, got ", discordgo.EndpointDiscord)
}
if discordgo.EndpointUsers != "https://example.org/api/v"+discordgo.APIVersion+"/users/" {
t.Error("Expected https://example.org/api/v"+discordgo.APIVersion+"/users/, got ", discordgo.EndpointDiscord)
}
if discordgo.EndpointGateway != "https://example.org/api/v"+discordgo.APIVersion+"/gateway" {
t.Error("Expected https://example.org/api/v"+discordgo.APIVersion+"/gateway, got ", discordgo.EndpointDiscord)
}
if discordgo.EndpointGatewayBot != "https://example.org/api/v"+discordgo.APIVersion+"/gateway/bot" {
t.Error("Expected https://example.org/api/v"+discordgo.APIVersion+"/gateway/bot, got ", discordgo.EndpointDiscord)
}
if discordgo.EndpointWebhooks != "https://example.org/api/v"+discordgo.APIVersion+"/webhooks/" {
t.Error("Expected https://example.org/api/v"+discordgo.APIVersion+"/webhooks/, got ", discordgo.EndpointDiscord)
}
}