Merge pull request #375 from Eivel/develop
Handle error in NewWebhook and NewWebhookWithCert
This commit is contained in:
commit
53d566ba56
3 changed files with 69 additions and 12 deletions
|
@ -4,6 +4,31 @@ import (
|
|||
"testing"
|
||||
)
|
||||
|
||||
func TestNewWebhook(t *testing.T) {
|
||||
result, err := NewWebhook("https://example.com/token")
|
||||
|
||||
if err != nil ||
|
||||
result.URL.String() != "https://example.com/token" ||
|
||||
result.Certificate != interface{}(nil) ||
|
||||
result.MaxConnections != 0 ||
|
||||
len(result.AllowedUpdates) != 0 {
|
||||
t.Fail()
|
||||
}
|
||||
}
|
||||
|
||||
func TestNewWebhookWithCert(t *testing.T) {
|
||||
exampleFile := File{FileID: "123"}
|
||||
result, err := NewWebhookWithCert("https://example.com/token", exampleFile)
|
||||
|
||||
if err != nil ||
|
||||
result.URL.String() != "https://example.com/token" ||
|
||||
result.Certificate != exampleFile ||
|
||||
result.MaxConnections != 0 ||
|
||||
len(result.AllowedUpdates) != 0 {
|
||||
t.Fail()
|
||||
}
|
||||
}
|
||||
|
||||
func TestNewInlineQueryResultArticle(t *testing.T) {
|
||||
result := NewInlineQueryResultArticle("id", "title", "message")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue