MCPcopy
hub / github.com/gotify/server / bootTestServer

Function bootTestServer

api/stream/stream_test.go:591–600  ·  view source on GitHub ↗
(handlerFunc gin.HandlerFunc)

Source from the content-addressed store, hash-verified

589}
590
591func bootTestServer(handlerFunc gin.HandlerFunc) (*httptest.Server, *API) {
592 r := gin.New()
593 r.Use(handlerFunc)
594 // ping every 500 ms, and the client has 500 ms to respond
595 api := New(500*time.Millisecond, 500*time.Millisecond, []string{})
596
597 r.GET("/", api.Handle)
598 server := httptest.NewServer(r)
599 return server, api
600}
601
602func wsURL(httpURL string) string {
603 return "ws" + strings.TrimPrefix(httpURL, "http")

Callers 11

TestWriteMessageFailsFunction · 0.85
TestWritePingFailsFunction · 0.85
TestPingFunction · 0.85
TestDeleteUserFunction · 0.85
TestMultipleClientsFunction · 0.85

Calls 1

NewFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…