Skip to content

Commit

Permalink
added tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Allan-Nava authored Jul 26, 2024
1 parent 10248ee commit 6b072fc
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 6 deletions.
2 changes: 1 addition & 1 deletion test/a_main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func TestNewTikTok(t *testing.T) {
if err != nil {
t.Fatalf(err.Error())
}
c.IsDebug()
log.Println(c.IsDebug())

Check failure on line 26 in test/a_main_test.go

View workflow job for this annotation

GitHub Actions / build (1.20.x)

undefined: log

Check failure on line 26 in test/a_main_test.go

View workflow job for this annotation

GitHub Actions / build (1.21.x)

undefined: log

Check failure on line 26 in test/a_main_test.go

View workflow job for this annotation

GitHub Actions / build (1.22.x)

undefined: log
}

func GetTikTok() (tiktok.ITiktok, error) {
Expand Down
20 changes: 20 additions & 0 deletions test/api_content_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package test

import (
"os"

Check failure on line 4 in test/api_content_test.go

View workflow job for this annotation

GitHub Actions / build (1.20.x)

"os" imported and not used

Check failure on line 4 in test/api_content_test.go

View workflow job for this annotation

GitHub Actions / build (1.21.x)

"os" imported and not used

Check failure on line 4 in test/api_content_test.go

View workflow job for this annotation

GitHub Actions / build (1.22.x)

"os" imported and not used
"testing"

"github.com/HiWay-Media/tiktok-go-sdk/tiktok"

Check failure on line 7 in test/api_content_test.go

View workflow job for this annotation

GitHub Actions / build (1.20.x)

"github.com/HiWay-Media/tiktok-go-sdk/tiktok" imported and not used

Check failure on line 7 in test/api_content_test.go

View workflow job for this annotation

GitHub Actions / build (1.21.x)

"github.com/HiWay-Media/tiktok-go-sdk/tiktok" imported and not used

Check failure on line 7 in test/api_content_test.go

View workflow job for this annotation

GitHub Actions / build (1.22.x)

"github.com/HiWay-Media/tiktok-go-sdk/tiktok" imported and not used
)

func Test(t *testing.T) {
c, err := GetTikTok()
if err != nil {
t.Fatalf(err.Error())
}
resp , err := c.CreatorInfo()
if err != nil {
t.Fatalf(err.Error())
}
log.Println("resp ", resp)

Check failure on line 19 in test/api_content_test.go

View workflow job for this annotation

GitHub Actions / build (1.20.x)

undefined: log

Check failure on line 19 in test/api_content_test.go

View workflow job for this annotation

GitHub Actions / build (1.21.x)

undefined: log

Check failure on line 19 in test/api_content_test.go

View workflow job for this annotation

GitHub Actions / build (1.22.x)

undefined: log
}
10 changes: 5 additions & 5 deletions tiktok/tiktok.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ type ITiktok interface {
}

type tiktok struct {
restClient *resty.Client
debug bool
clientKey string
clientSecret string
accessToken string
restClient *resty.Client
debug bool
clientKey string
clientSecret string
accessToken string
}

func NewTikTok(clientKey, clientSecret string, isDebug bool) (ITiktok, error) {
Expand Down

0 comments on commit 6b072fc

Please sign in to comment.