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

Fix code formatting

This commit is contained in:
Henrik Hautakoski 2022-11-23 15:52:19 +01:00
parent b0e5b455ca
commit adb1ad3c6d
No known key found for this signature in database
GPG key ID: 608414D93E862CCD
21 changed files with 884 additions and 950 deletions

View file

@ -3,20 +3,20 @@ package api
import (
"reflect"
"testing"
"github.com/stretchr/testify/assert"
"github.com/eosswedenorg-go/haproxy/agentcheck"
"github.com/stretchr/testify/assert"
)
func TestDebugApiFactory(t *testing.T) {
api := DebugApiFactory(ApiArguments{
Url: "up",
Host: "host",
NumBlocks: 40,
})
api := DebugApiFactory(ApiArguments{
Url: "up",
Host: "host",
NumBlocks: 40,
})
assert.IsType(t, DebugApi{}, api)
assert.Equal(t, api.(DebugApi).response, agentcheck.NewStatusResponse(agentcheck.Up))
assert.IsType(t, DebugApi{}, api)
assert.Equal(t, api.(DebugApi).response, agentcheck.NewStatusResponse(agentcheck.Up))
}
func TestNewDebugApi(t *testing.T) {
@ -43,26 +43,24 @@ func TestNewDebugApi(t *testing.T) {
}
func TestDebugApi_LogInfo(t *testing.T) {
expected := LogParams{"type", "Debug", "response", "up"}
expected := LogParams{"type", "Debug", "response", "up"}
api := DebugApi{
response: agentcheck.NewStatusResponse(agentcheck.Up),
}
api := DebugApi{
response: agentcheck.NewStatusResponse(agentcheck.Up),
}
assert.Equal(t, api.LogInfo(), expected)
assert.Equal(t, api.LogInfo(), expected)
}
func TestDebugApi_Call(t *testing.T) {
expected := agentcheck.NewStatusMessageResponse(agentcheck.Stopped, "message")
expected := agentcheck.NewStatusMessageResponse(agentcheck.Stopped, "message")
api := DebugApi{
response: expected,
}
api := DebugApi{
response: expected,
}
response, msg := api.Call()
response, msg := api.Call()
assert.Equal(t, response, expected)
assert.Equal(t, msg, "")
assert.Equal(t, response, expected)
assert.Equal(t, msg, "")
}