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

Function TestClientPushWithNilContext

client_test.go:214–227  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

212}
213
214func TestClientPushWithNilContext(t *testing.T) {
215 n := mockNotification()
216 var apnsID = "02ABC856-EF8D-4E49-8F15-7B8A61D978D6"
217 server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
218 w.Header().Set("Content-Type", "application/json; charset=utf-8")
219 w.Header().Set("apns-id", apnsID)
220 w.WriteHeader(http.StatusOK)
221 }))
222 defer server.Close()
223
224 res, err := mockClient(server.URL).PushWithContext(nil, n)
225 assert.EqualError(t, err, "net/http: nil Context")
226 assert.Nil(t, res)
227}
228
229func TestHeaders(t *testing.T) {
230 n := mockNotification()

Callers

nothing calls this directly

Calls 3

mockNotificationFunction · 0.85
mockClientFunction · 0.85
PushWithContextMethod · 0.80

Tested by

no test coverage detected