mirror of
https://github.com/eosswedenorg/antelope-api-healthcheck
synced 2026-07-03 11:53:43 +02:00
src/api/v2_test.go: Add test for LogInfo()
This commit is contained in:
parent
7f45b746c1
commit
a550f67dca
1 changed files with 9 additions and 0 deletions
|
|
@ -9,6 +9,15 @@ import (
|
||||||
"github.com/eosswedenorg-go/haproxy/agentcheck"
|
"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) {
|
func TestV2JsonFailure(t *testing.T) {
|
||||||
|
|
||||||
var srv = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
|
var srv = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue