add new commit
This commit is contained in:
parent
7544964508
commit
ea59675755
12 changed files with 123 additions and 38 deletions
|
@ -12,6 +12,7 @@ import (
|
|||
func TestGetFavourites(t *testing.T) {
|
||||
ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
fmt.Fprintln(w, `[{"content": "foo"}, {"content": "bar"}]`)
|
||||
return
|
||||
}))
|
||||
defer ts.Close()
|
||||
|
||||
|
@ -39,6 +40,7 @@ func TestGetFavourites(t *testing.T) {
|
|||
func TestGetBookmarks(t *testing.T) {
|
||||
ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
fmt.Fprintln(w, `[{"content": "foo"}, {"content": "bar"}]`)
|
||||
return
|
||||
}))
|
||||
defer ts.Close()
|
||||
|
||||
|
@ -70,6 +72,7 @@ func TestGetStatus(t *testing.T) {
|
|||
return
|
||||
}
|
||||
fmt.Fprintln(w, `{"content": "zzz", "emojis":[{"shortcode":"💩", "url":"http://example.com", "static_url": "http://example.com/static"}]}`)
|
||||
return
|
||||
}))
|
||||
defer ts.Close()
|
||||
|
||||
|
@ -111,6 +114,7 @@ func TestGetStatusCard(t *testing.T) {
|
|||
return
|
||||
}
|
||||
fmt.Fprintln(w, `{"title": "zzz"}`)
|
||||
return
|
||||
}))
|
||||
defer ts.Close()
|
||||
|
||||
|
@ -140,6 +144,7 @@ func TestGetStatusContext(t *testing.T) {
|
|||
return
|
||||
}
|
||||
fmt.Fprintln(w, `{"ancestors": [{"content": "zzz"},{"content": "bbb"}]}`)
|
||||
return
|
||||
}))
|
||||
defer ts.Close()
|
||||
|
||||
|
@ -178,6 +183,7 @@ func TestGetRebloggedBy(t *testing.T) {
|
|||
return
|
||||
}
|
||||
fmt.Fprintln(w, `[{"username": "foo"}, {"username": "bar"}]`)
|
||||
return
|
||||
}))
|
||||
defer ts.Close()
|
||||
|
||||
|
@ -213,6 +219,7 @@ func TestGetFavouritedBy(t *testing.T) {
|
|||
return
|
||||
}
|
||||
fmt.Fprintln(w, `[{"username": "foo"}, {"username": "bar"}]`)
|
||||
return
|
||||
}))
|
||||
defer ts.Close()
|
||||
|
||||
|
@ -248,6 +255,7 @@ func TestReblog(t *testing.T) {
|
|||
return
|
||||
}
|
||||
fmt.Fprintln(w, `{"content": "zzz"}`)
|
||||
return
|
||||
}))
|
||||
defer ts.Close()
|
||||
|
||||
|
@ -277,6 +285,7 @@ func TestUnreblog(t *testing.T) {
|
|||
return
|
||||
}
|
||||
fmt.Fprintln(w, `{"content": "zzz"}`)
|
||||
return
|
||||
}))
|
||||
defer ts.Close()
|
||||
|
||||
|
@ -306,6 +315,7 @@ func TestFavourite(t *testing.T) {
|
|||
return
|
||||
}
|
||||
fmt.Fprintln(w, `{"content": "zzz"}`)
|
||||
return
|
||||
}))
|
||||
defer ts.Close()
|
||||
|
||||
|
@ -335,6 +345,7 @@ func TestUnfavourite(t *testing.T) {
|
|||
return
|
||||
}
|
||||
fmt.Fprintln(w, `{"content": "zzz"}`)
|
||||
return
|
||||
}))
|
||||
defer ts.Close()
|
||||
|
||||
|
@ -364,6 +375,7 @@ func TestBookmark(t *testing.T) {
|
|||
return
|
||||
}
|
||||
fmt.Fprintln(w, `{"content": "zzz"}`)
|
||||
return
|
||||
}))
|
||||
defer ts.Close()
|
||||
|
||||
|
@ -393,6 +405,7 @@ func TestUnbookmark(t *testing.T) {
|
|||
return
|
||||
}
|
||||
fmt.Fprintln(w, `{"content": "zzz"}`)
|
||||
return
|
||||
}))
|
||||
defer ts.Close()
|
||||
|
||||
|
@ -474,6 +487,7 @@ func TestGetTimelineHashtag(t *testing.T) {
|
|||
return
|
||||
}
|
||||
fmt.Fprintln(w, `[{"content": "zzz"},{"content": "yyy"}]`)
|
||||
return
|
||||
}))
|
||||
defer ts.Close()
|
||||
|
||||
|
@ -509,6 +523,7 @@ func TestGetTimelineList(t *testing.T) {
|
|||
return
|
||||
}
|
||||
fmt.Fprintln(w, `[{"content": "zzz"},{"content": "yyy"}]`)
|
||||
return
|
||||
}))
|
||||
defer ts.Close()
|
||||
|
||||
|
@ -544,6 +559,7 @@ func TestGetTimelineMedia(t *testing.T) {
|
|||
return
|
||||
}
|
||||
fmt.Fprintln(w, `[{"content": "zzz"},{"content": "yyy"}]`)
|
||||
return
|
||||
}))
|
||||
defer ts.Close()
|
||||
|
||||
|
@ -582,6 +598,7 @@ func TestDeleteStatus(t *testing.T) {
|
|||
http.Error(w, http.StatusText(http.StatusNotFound), http.StatusMethodNotAllowed)
|
||||
return
|
||||
}
|
||||
return
|
||||
}))
|
||||
defer ts.Close()
|
||||
|
||||
|
@ -617,6 +634,7 @@ func TestSearch(t *testing.T) {
|
|||
"statuses":[{"content": "aaa"}],
|
||||
"hashtags":[{"name": "tag"},{"name": "tag2"},{"name": "tag3"}]
|
||||
}`)
|
||||
return
|
||||
}))
|
||||
defer ts.Close()
|
||||
|
||||
|
@ -661,6 +679,7 @@ func TestUploadMedia(t *testing.T) {
|
|||
return
|
||||
}
|
||||
fmt.Fprintln(w, `{"id": 123}`)
|
||||
return
|
||||
}))
|
||||
defer ts.Close()
|
||||
|
||||
|
@ -697,6 +716,7 @@ func TestGetConversations(t *testing.T) {
|
|||
http.Error(w, http.StatusText(http.StatusNotFound), http.StatusNotFound)
|
||||
}
|
||||
fmt.Fprintln(w, `[{"id": "4", "unread":false, "last_status" : {"content": "zzz"}}, {"id": "3", "unread":true, "last_status" : {"content": "bar"}}]`)
|
||||
return
|
||||
}))
|
||||
defer ts.Close()
|
||||
|
||||
|
@ -734,6 +754,7 @@ func TestDeleteConversation(t *testing.T) {
|
|||
http.Error(w, http.StatusText(http.StatusNotFound), http.StatusMethodNotAllowed)
|
||||
return
|
||||
}
|
||||
return
|
||||
}))
|
||||
defer ts.Close()
|
||||
|
||||
|
@ -759,6 +780,7 @@ func TestMarkConversationsAsRead(t *testing.T) {
|
|||
http.Error(w, http.StatusText(http.StatusNotFound), http.StatusNotFound)
|
||||
return
|
||||
}
|
||||
return
|
||||
}))
|
||||
defer ts.Close()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue