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

src/api/v2_test.go: Add test for LogInfo()

This commit is contained in:
Henrik Hautakoski 2022-08-17 16:55:05 +02:00
parent 7f45b746c1
commit a550f67dca
No known key found for this signature in database
GPG key ID: 608414D93E862CCD

View file

@ -9,6 +9,15 @@ import (
"github.com/eosswedenorg-go/haproxy/agentcheck"
)
func TestV2LogInfo(t *testing.T) {
api := NewEosioV2("https://api.v2.example.com", "host.example.com", 120)
expected := LogParams{"type","eosio-v2","url","https://api.v2.example.com","host","host.example.com","offset",int64(120)}
assert.Equal(t, expected, api.LogInfo())
}
func TestV2JsonFailure(t *testing.T) {
var srv = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {