MCPcopy
hub / github.com/sideshow/apns2 / TestURL

Function TestURL

client_test.go:152–161  ·  view source on GitHub ↗

Functional Tests

(t *testing.T)

Source from the content-addressed store, hash-verified

150// Functional Tests
151
152func TestURL(t *testing.T) {
153 n := mockNotification()
154 server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
155 assert.Equal(t, "POST", r.Method)
156 assert.Equal(t, fmt.Sprintf("/3/device/%s", n.DeviceToken), r.URL.String())
157 }))
158 defer server.Close()
159 _, err := mockClient(server.URL).Push(n)
160 assert.NoError(t, err)
161}
162
163func TestDefaultHeaders(t *testing.T) {
164 n := mockNotification()

Callers

nothing calls this directly

Calls 3

mockNotificationFunction · 0.85
mockClientFunction · 0.85
PushMethod · 0.80

Tested by

no test coverage detected