Skip to content

Commit

Permalink
added TestAuthCodeUrl
Browse files Browse the repository at this point in the history
  • Loading branch information
Allan-Nava authored Jul 29, 2024
1 parent 1ea9415 commit d9665c4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
15 changes: 15 additions & 0 deletions test/a_main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,20 @@ func TestNewTikTok(t *testing.T) {
log.Println(c.IsDebug())
}

func TestAuthCodeUrl(t *testing.T){
c, err := GetTikTok()
if err != nil {
t.Fatalf(err.Error())
}
resp, err := c.CodeAuthUrl()

Check failure on line 35 in test/a_main_test.go

View workflow job for this annotation

GitHub Actions / build (1.21.x)

assignment mismatch: 2 variables but c.CodeAuthUrl returns 1 value

Check failure on line 35 in test/a_main_test.go

View workflow job for this annotation

GitHub Actions / build (1.22.x)

assignment mismatch: 2 variables but c.CodeAuthUrl returns 1 value
if err != nil {
t.Fatalf(err.Error())
}
log.Println("resp ", resp)
}



func GetTikTok() (tiktok.ITiktok, error) {
clientKey := os.Getenv("CLIENT_KEY")
clientSecret := os.Getenv("CLIENT_SECRET")
Expand All @@ -37,3 +51,4 @@ func GetTikTok() (tiktok.ITiktok, error) {
}
return c, nil
}

4 changes: 2 additions & 2 deletions test/api_content_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ func TestGetVideoList( t *testing.T){
t.Fatalf(err.Error())
}
c.IsDebug()
resp, err := c.GetVideoList(int64(20))
/*resp, err := c.GetVideoList(int64(20))
if err != nil {
t.Fatalf(err.Error())
}
log.Println("resp ", resp)
log.Println("resp ", resp)*/
}

0 comments on commit d9665c4

Please sign in to comment.