mirror of
https://github.com/mpolden/echoip.git
synced 2025-07-21 00:06:08 +02:00
Refactor
This commit is contained in:
@ -85,6 +85,9 @@ func TestJSONHandlers(t *testing.T) {
|
||||
status int
|
||||
}{
|
||||
{s.URL, `{"ip":"127.0.0.1","country":"Elbonia","city":"Bornyasherk","hostname":"localhost"}`, 200},
|
||||
{s.URL + "/port/foo", `{"error":"404 page not found"}`, 404},
|
||||
{s.URL + "/port/0", `{"error":"Invalid port: 0"}`, 400},
|
||||
{s.URL + "/port/65356", `{"error":"Invalid port: 65356"}`, 400},
|
||||
{s.URL + "/port/31337", `{"ip":"127.0.0.1","port":31337,"reachable":true}`, 200},
|
||||
{s.URL + "/foo", `{"error":"404 page not found"}`, 404},
|
||||
}
|
||||
|
Reference in New Issue
Block a user