add new commit
This commit is contained in:
parent
7544964508
commit
ea59675755
12 changed files with 123 additions and 38 deletions
|
@ -15,6 +15,7 @@ func TestGetReports(t *testing.T) {
|
|||
return
|
||||
}
|
||||
fmt.Fprintln(w, `[{"id": 122, "action_taken": false}, {"id": 123, "action_taken": true}]`)
|
||||
return
|
||||
}))
|
||||
defer ts.Close()
|
||||
|
||||
|
@ -54,6 +55,7 @@ func TestReport(t *testing.T) {
|
|||
} else {
|
||||
fmt.Fprintln(w, `{"id": 1234, "action_taken": true}`)
|
||||
}
|
||||
return
|
||||
}))
|
||||
defer ts.Close()
|
||||
|
||||
|
@ -63,11 +65,11 @@ func TestReport(t *testing.T) {
|
|||
ClientSecret: "bar",
|
||||
AccessToken: "zoo",
|
||||
})
|
||||
_, err := client.Report(context.Background(), "121", nil, "")
|
||||
rp, err := client.Report(context.Background(), "121", nil, "")
|
||||
if err == nil {
|
||||
t.Fatalf("should be fail: %v", err)
|
||||
}
|
||||
rp, err := client.Report(context.Background(), "122", nil, "")
|
||||
rp, err = client.Report(context.Background(), "122", nil, "")
|
||||
if err != nil {
|
||||
t.Fatalf("should not be fail: %v", err)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue