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

Function TestClientPushWithContext

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

Source from the content-addressed store, hash-verified

197}
198
199func TestClientPushWithContext(t *testing.T) {
200 n := mockNotification()
201 var apnsID = "02ABC856-EF8D-4E49-8F15-7B8A61D978D6"
202 server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
203 w.Header().Set("Content-Type", "application/json; charset=utf-8")
204 w.Header().Set("apns-id", apnsID)
205 w.WriteHeader(http.StatusOK)
206 }))
207 defer server.Close()
208
209 res, err := mockClient(server.URL).PushWithContext(context.Background(), n)
210 assert.Nil(t, err)
211 assert.Equal(t, res.ApnsID, apnsID)
212}
213
214func TestClientPushWithNilContext(t *testing.T) {
215 n := mockNotification()

Callers

nothing calls this directly

Calls 3

mockNotificationFunction · 0.85
mockClientFunction · 0.85
PushWithContextMethod · 0.80

Tested by

no test coverage detected