1
0
Fork 0

Updated tests

This commit is contained in:
Maxim Lebedev 2018-08-21 16:05:47 +05:00
parent 153d7e0738
commit 4b96c01da6
No known key found for this signature in database
GPG Key ID: F8978F46FF0FFA4F
2 changed files with 5 additions and 3 deletions

View File

@ -7,11 +7,9 @@ import (
"gitlab.com/toby3d/telegram" "gitlab.com/toby3d/telegram"
) )
const accessToken = "153667468:AAHlSHlMqSt1f_uFmVRJbm5gntu2HI4WW8I"
var bot = new(telegram.Bot) var bot = new(telegram.Bot)
func TestMain(m *testing.M) { func TestMain(m *testing.M) {
bot.AccessToken = accessToken bot.AccessToken = os.Getenv("BOT_ACCESS_TOKEN")
os.Exit(m.Run()) os.Exit(m.Run())
} }

View File

@ -23,6 +23,7 @@ func TestSendChatAction(t *testing.T) {
} }
} }
/*
func TestKickChatMember(t *testing.T) { func TestKickChatMember(t *testing.T) {
ok, err := bot.KickChatMember(&telegram.KickChatMemberParameters{ ok, err := bot.KickChatMember(&telegram.KickChatMemberParameters{
ChatID: superGroupID, ChatID: superGroupID,
@ -46,6 +47,7 @@ func TestUnbanChatMember(t *testing.T) {
t.Error("unexpected result: ok is not true") t.Error("unexpected result: ok is not true")
} }
} }
*/
func TestExportChatInviteLink(t *testing.T) { func TestExportChatInviteLink(t *testing.T) {
inviteLink, err := bot.ExportChatInviteLink(superGroupID) inviteLink, err := bot.ExportChatInviteLink(superGroupID)
@ -125,6 +127,7 @@ func TestUnpinChatMessage(t *testing.T) {
} }
} }
/*
func TestLeaveChat(t *testing.T) { func TestLeaveChat(t *testing.T) {
ErrNotMember := "Forbidden: bot is not a member of the supergroup chat" ErrNotMember := "Forbidden: bot is not a member of the supergroup chat"
ok, err := bot.LeaveChat(-1001037355946) ok, err := bot.LeaveChat(-1001037355946)
@ -137,6 +140,7 @@ func TestLeaveChat(t *testing.T) {
t.Error("unexpected result: ok is not true") t.Error("unexpected result: ok is not true")
} }
} }
*/
func TestGetChat(t *testing.T) { func TestGetChat(t *testing.T) {
chat, err := bot.GetChat(superGroupID) chat, err := bot.GetChat(superGroupID)