This commit is contained in:
Martin Polden
2016-04-27 17:07:53 +02:00
parent c8db4935ca
commit 2c5f4e08b5
2 changed files with 27 additions and 17 deletions

View File

@ -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},
}