Skip to content

Commit

Permalink
remove testify/assert package
Browse files Browse the repository at this point in the history
Signed-off-by: 1046102779 <seachen@tencent.com>
  • Loading branch information
1046102779 committed Dec 13, 2022
1 parent 06bafdc commit 682959b
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions linebot/webhook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,13 @@ import (
"crypto/tls"
"encoding/base64"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"net/http/httptest"
"reflect"
"strconv"
"testing"
"time"

"github.com/stretchr/testify/assert"
)

var webhookTestRequestBody = `{
Expand Down Expand Up @@ -2127,12 +2124,16 @@ func TestParseRequestEvents(t *testing.T) {
Events []*Event `json:"events"`
}{}
err := json.Unmarshal([]byte(webhookTestRequestBody), request)
assert.Nil(t, err)
if err != nil {
t.Error(t, err)
}

for _, event := range request.Events {
switch event.Type {
case EventTypeMessage:
assert.NotEmptyf(t, event.Message.Type(), fmt.Sprintf("message type: %s", event.Message.Type()))
if event.Message.Type() == "" {
t.Error("message type is empty")
}
}
}
}

0 comments on commit 682959b

Please sign in to comment.