mirror of
https://github.com/eosswedenorg/antelope-api-healthcheck
synced 2026-07-03 11:53:43 +02:00
src/parse_request_test.go: add test for invalid api type.
This commit is contained in:
parent
11c1e8afcd
commit
bda40bf1d5
1 changed files with 8 additions and 0 deletions
|
|
@ -8,6 +8,14 @@ import (
|
||||||
"github.com/eosswedenorg/eosio-api-healthcheck/src/api"
|
"github.com/eosswedenorg/eosio-api-healthcheck/src/api"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func TestParseWithInvalidApi(t *testing.T) {
|
||||||
|
|
||||||
|
api, err := ParseRequest("invalid|http://api.example.com")
|
||||||
|
assert.Error(t, err)
|
||||||
|
assert.Equal(t, err.Error(), "Invalid API 'invalid'")
|
||||||
|
assert.Nil(t, api)
|
||||||
|
}
|
||||||
|
|
||||||
func TestParseWithInvalidParams(t *testing.T) {
|
func TestParseWithInvalidParams(t *testing.T) {
|
||||||
|
|
||||||
api, err := ParseRequest("v1")
|
api, err := ParseRequest("v1")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue