mirror of
https://github.com/eiblog/eiblog.git
synced 2026-02-04 13:52:26 +08:00
add test
This commit is contained in:
@@ -159,7 +159,6 @@ func PostComment(pc *PostCreate) string {
|
||||
return ""
|
||||
}
|
||||
request.Header.Set("Referer", "https://disqus.com")
|
||||
logd.Print(*request)
|
||||
resp, err := http.DefaultClient.Do(request)
|
||||
if err != nil {
|
||||
logd.Error(err)
|
||||
|
||||
@@ -7,3 +7,19 @@ import (
|
||||
func TestDisqus(t *testing.T) {
|
||||
PostsCount()
|
||||
}
|
||||
|
||||
func TestPostComment(t *testing.T) {
|
||||
pc := &PostCreate{
|
||||
Message: "hahahaha",
|
||||
Thread: "52799014",
|
||||
AuthorEmail: "deepzz.qi@gmail.com",
|
||||
AuthorName: "deepzz",
|
||||
}
|
||||
|
||||
id := PostComment(pc)
|
||||
if id == "" {
|
||||
t.Error("post failed")
|
||||
return
|
||||
}
|
||||
t.Log("post success")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user