mirror of
https://github.com/datarhei/core.git
synced 2025-10-05 07:57:13 +08:00

Commits (Ingo Oppermann): - Add experimental SRT connection stats and logs - Hide /config/reload endpoint in reade-only mode - Add SRT server - Create v16 in go.mod - Fix data races, tests, lint, and update dependencies - Add trailing slash for routed directories (datarhei/restreamer#340) - Allow relative URLs in content in static routes Co-Authored-By: Ingo Oppermann <57445+ioppermann@users.noreply.github.com>
31 lines
543 B
Go
31 lines
543 B
Go
package api
|
|
|
|
import (
|
|
"net/http"
|
|
"testing"
|
|
|
|
"github.com/datarhei/core/v16/http/api"
|
|
"github.com/datarhei/core/v16/http/mock"
|
|
"github.com/labstack/echo/v4"
|
|
)
|
|
|
|
func getDummyAboutRouter() *echo.Echo {
|
|
router := mock.DummyEcho()
|
|
|
|
rs := mock.DummyRestreamer()
|
|
|
|
handler := NewAbout(rs, []string{})
|
|
|
|
router.Add("GET", "/", handler.About)
|
|
|
|
return router
|
|
}
|
|
|
|
func TestAbout(t *testing.T) {
|
|
router := getDummyAboutRouter()
|
|
|
|
response := mock.Request(t, http.StatusOK, router, "GET", "/", nil)
|
|
|
|
mock.Validate(t, &api.About{}, response.Data)
|
|
}
|