1
0
Fork 0
mirror of https://github.com/eosswedenorg/antelope-api-healthcheck synced 2026-06-19 05:10:02 +02:00

src/api/debug.go: Adding DebugApiFactory function

This commit is contained in:
Henrik Hautakoski 2022-10-25 17:31:36 +02:00
parent 6e8ffe718e
commit 39927a2441
No known key found for this signature in database
GPG key ID: 608414D93E862CCD
2 changed files with 16 additions and 0 deletions

View file

@ -7,6 +7,18 @@ import (
"github.com/eosswedenorg-go/haproxy/agentcheck"
)
func TestDebugApiFactory(t *testing.T) {
api := DebugApiFactory(ApiArguments{
Url: "up",
Host: "host",
NumBlocks: 40,
})
assert.IsType(t, DebugApi{}, api)
assert.Equal(t, api.(DebugApi).response, agentcheck.NewStatusResponse(agentcheck.Up))
}
func TestNewDebugApi(t *testing.T) {
type args struct {
response string