Test /coordinates

This commit is contained in:
Martin Polden 2018-08-27 21:48:08 +02:00
parent 3e1d4425cd
commit 823af68923
2 changed files with 2 additions and 1 deletions

View File

@ -169,7 +169,7 @@ func (s *Server) CLICoordinatesHandler(w http.ResponseWriter, r *http.Request) *
if err != nil {
return internalServerError(err)
}
fmt.Fprintf(w, "%s, %s\n", formatCoordinate(response.Latitude), formatCoordinate(response.Longitude))
fmt.Fprintf(w, "%s,%s\n", formatCoordinate(response.Latitude), formatCoordinate(response.Longitude))
return nil
}

View File

@ -67,6 +67,7 @@ func TestCLIHandlers(t *testing.T) {
{s.URL + "/ip", "127.0.0.1\n", 200, "", ""},
{s.URL + "/country", "Elbonia\n", 200, "", ""},
{s.URL + "/country-iso", "EB\n", 200, "", ""},
{s.URL + "/coordinates", "63.416667,10.416667\n", 200, "", ""},
{s.URL + "/city", "Bornyasherk\n", 200, "", ""},
{s.URL + "/foo", "404 page not found", 404, "", ""},
}