forked from o1egl/go-wordpress
-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathstatuses_test.go
More file actions
38 lines (31 loc) · 813 Bytes
/
Copy pathstatuses_test.go
File metadata and controls
38 lines (31 loc) · 813 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package wordpress_test
import (
"net/http"
"testing"
)
func TestStatusesList(t *testing.T) {
wp, ctx := initTestClient()
statuses, resp, err := wp.Statuses.List(ctx, nil)
if err != nil {
t.Errorf("Should not return error: %v", err.Error())
}
if resp != nil && resp.StatusCode != http.StatusOK {
t.Errorf("Expected 200 OK, got %v", resp.Status)
}
if statuses == nil {
t.Errorf("Should not return nil statuses")
}
}
func TestStatusesGet(t *testing.T) {
wp, ctx := initTestClient()
status, resp, err := wp.Statuses.Get(ctx, "publish", nil)
if err != nil {
t.Errorf("Should not return error: %v", err.Error())
}
if resp != nil && resp.StatusCode != http.StatusOK {
t.Errorf("Expected 200 OK, got %v", resp.Status)
}
if status == nil {
t.Errorf("Should not return nil status")
}
}