Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Commit

Permalink
修复一些测试和结构体
Browse files Browse the repository at this point in the history
  • Loading branch information
songjiaxin committed Aug 7, 2020
1 parent 1531b89 commit 398037a
Show file tree
Hide file tree
Showing 13 changed files with 12 additions and 1,948 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@
.DS_Store
.idea
.vscode

# go
vendor
12 changes: 9 additions & 3 deletions crawler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,28 @@ const columnName = "OTalk" // https://zhuanlan.zhihu.com/Otalk
const pid = 60968502 // https://zhuanlan.zhihu.com/p/60968502

func TestClient_GetPinnedArticlePidAndAuthor(t *testing.T) {
_, err := GetPinnedArticlePidAndAuthor(columnName)
info, err := GetPinnedArticlePidAndAuthor(columnName)
if err != nil {
t.Error(err.Error())
return
}
t.Logf("%+v\n", *info)
}

func TestClient_GetArticlesListPids(t *testing.T) {
_, err := GetArticlesListPids(columnName)
pids, err := GetArticlesListPids(columnName)
if err != nil {
t.Error(err.Error())
return
}
t.Logf("%+v\n", pids)
}

func TestClient_GetSingleArticle(t *testing.T) {
_, err := GetSingleArticle(pid)
article, err := GetSingleArticle(pid)
if err != nil {
t.Error(err.Error())
return
}
t.Logf("%+v\n", *article)
}
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
github.com/imroc/req v0.2.4 h1:8XbvaQpERLAJV6as/cB186DtH5f0m5zAOtHEaTQ4ac0=
github.com/imroc/req v0.2.4/go.mod h1:J9FsaNHDTIVyW/b5r6/Df5qKEEEq2WzZKIgKSajd1AE=
github.com/imroc/req v0.3.0 h1:3EioagmlSG+z+KySToa+Ylo3pTFZs+jh3Brl7ngU12U=
github.com/imroc/req v0.3.0/go.mod h1:F+NZ+2EFSo6EFXdeIbpfE9hcC233id70kf0byW97Caw=
1 change: 0 additions & 1 deletion model.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ type Author struct {
URL string `json:"url"`
URLToken string `json:"url_token"`
UserType string `json:"user_type"`
AvatarURL string `json:"avatar_url"`
}

type PinnedArticleAndAuthor struct {
Expand Down
201 changes: 0 additions & 201 deletions vendor/github.com/imroc/req/LICENSE

This file was deleted.

Loading

0 comments on commit 398037a

Please sign in to comment.