add new commit
This commit is contained in:
parent
7544964508
commit
ea59675755
12 changed files with 123 additions and 38 deletions
|
@ -118,6 +118,7 @@ func TestGetAccountStatuses(t *testing.T) {
|
|||
return
|
||||
}
|
||||
fmt.Fprintln(w, `[{"content": "foo"}, {"content": "bar"}]`)
|
||||
return
|
||||
}))
|
||||
defer ts.Close()
|
||||
|
||||
|
@ -150,6 +151,7 @@ func TestGetAccountFollowers(t *testing.T) {
|
|||
return
|
||||
}
|
||||
fmt.Fprintln(w, `[{"username": "foo"}, {"username": "bar"}]`)
|
||||
return
|
||||
}))
|
||||
defer ts.Close()
|
||||
|
||||
|
@ -185,6 +187,7 @@ func TestGetAccountFollowing(t *testing.T) {
|
|||
return
|
||||
}
|
||||
fmt.Fprintln(w, `[{"username": "foo"}, {"username": "bar"}]`)
|
||||
return
|
||||
}))
|
||||
defer ts.Close()
|
||||
|
||||
|
@ -222,6 +225,7 @@ func TestGetBlocks(t *testing.T) {
|
|||
return
|
||||
}
|
||||
fmt.Fprintln(w, `[{"username": "foo"}, {"username": "bar"}]`)
|
||||
return
|
||||
}))
|
||||
defer ts.Close()
|
||||
|
||||
|
@ -257,6 +261,7 @@ func TestAccountFollow(t *testing.T) {
|
|||
return
|
||||
}
|
||||
fmt.Fprintln(w, `{"id":1234567,"following":true}`)
|
||||
return
|
||||
}))
|
||||
defer ts.Close()
|
||||
|
||||
|
@ -266,11 +271,11 @@ func TestAccountFollow(t *testing.T) {
|
|||
ClientSecret: "bar",
|
||||
AccessToken: "zoo",
|
||||
})
|
||||
_, err := client.AccountFollow(context.Background(), "123")
|
||||
rel, err := client.AccountFollow(context.Background(), "123")
|
||||
if err == nil {
|
||||
t.Fatalf("should be fail: %v", err)
|
||||
}
|
||||
rel, err := client.AccountFollow(context.Background(), "1234567")
|
||||
rel, err = client.AccountFollow(context.Background(), "1234567")
|
||||
if err != nil {
|
||||
t.Fatalf("should not be fail: %v", err)
|
||||
}
|
||||
|
@ -289,6 +294,7 @@ func TestAccountUnfollow(t *testing.T) {
|
|||
return
|
||||
}
|
||||
fmt.Fprintln(w, `{"id":1234567,"following":false}`)
|
||||
return
|
||||
}))
|
||||
defer ts.Close()
|
||||
|
||||
|
@ -298,11 +304,11 @@ func TestAccountUnfollow(t *testing.T) {
|
|||
ClientSecret: "bar",
|
||||
AccessToken: "zoo",
|
||||
})
|
||||
_, err := client.AccountUnfollow(context.Background(), "123")
|
||||
rel, err := client.AccountUnfollow(context.Background(), "123")
|
||||
if err == nil {
|
||||
t.Fatalf("should be fail: %v", err)
|
||||
}
|
||||
rel, err := client.AccountUnfollow(context.Background(), "1234567")
|
||||
rel, err = client.AccountUnfollow(context.Background(), "1234567")
|
||||
if err != nil {
|
||||
t.Fatalf("should not be fail: %v", err)
|
||||
}
|
||||
|
@ -321,6 +327,7 @@ func TestAccountBlock(t *testing.T) {
|
|||
return
|
||||
}
|
||||
fmt.Fprintln(w, `{"id":1234567,"blocking":true}`)
|
||||
return
|
||||
}))
|
||||
defer ts.Close()
|
||||
|
||||
|
@ -353,6 +360,7 @@ func TestAccountUnblock(t *testing.T) {
|
|||
return
|
||||
}
|
||||
fmt.Fprintln(w, `{"id":1234567,"blocking":false}`)
|
||||
return
|
||||
}))
|
||||
defer ts.Close()
|
||||
|
||||
|
@ -385,6 +393,7 @@ func TestAccountMute(t *testing.T) {
|
|||
return
|
||||
}
|
||||
fmt.Fprintln(w, `{"id":1234567,"muting":true}`)
|
||||
return
|
||||
}))
|
||||
defer ts.Close()
|
||||
|
||||
|
@ -417,6 +426,7 @@ func TestAccountUnmute(t *testing.T) {
|
|||
return
|
||||
}
|
||||
fmt.Fprintln(w, `{"id":1234567,"muting":false}`)
|
||||
return
|
||||
}))
|
||||
defer ts.Close()
|
||||
|
||||
|
@ -482,6 +492,7 @@ func TestAccountsSearch(t *testing.T) {
|
|||
return
|
||||
}
|
||||
fmt.Fprintln(w, `[{"username": "foobar"}, {"username": "barfoo"}]`)
|
||||
return
|
||||
}))
|
||||
defer ts.Close()
|
||||
|
||||
|
@ -517,6 +528,7 @@ func TestFollowRemoteUser(t *testing.T) {
|
|||
return
|
||||
}
|
||||
fmt.Fprintln(w, `{"username": "zzz"}`)
|
||||
return
|
||||
}))
|
||||
defer ts.Close()
|
||||
|
||||
|
@ -548,6 +560,7 @@ func TestGetFollowRequests(t *testing.T) {
|
|||
return
|
||||
}
|
||||
fmt.Fprintln(w, `[{"username": "foo"}, {"username": "bar"}]`)
|
||||
return
|
||||
}))
|
||||
defer ts.Close()
|
||||
|
||||
|
@ -633,6 +646,7 @@ func TestGetMutes(t *testing.T) {
|
|||
return
|
||||
}
|
||||
fmt.Fprintln(w, `[{"username": "foo"}, {"username": "bar"}]`)
|
||||
return
|
||||
}))
|
||||
defer ts.Close()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue