mirror of
https://github.com/eiblog/eiblog.git
synced 2026-03-01 00:34:58 +08:00
add test
This commit is contained in:
@@ -159,7 +159,6 @@ func PostComment(pc *PostCreate) string {
|
|||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
request.Header.Set("Referer", "https://disqus.com")
|
request.Header.Set("Referer", "https://disqus.com")
|
||||||
logd.Print(*request)
|
|
||||||
resp, err := http.DefaultClient.Do(request)
|
resp, err := http.DefaultClient.Do(request)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logd.Error(err)
|
logd.Error(err)
|
||||||
|
|||||||
@@ -7,3 +7,19 @@ import (
|
|||||||
func TestDisqus(t *testing.T) {
|
func TestDisqus(t *testing.T) {
|
||||||
PostsCount()
|
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