X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/282c0da941df3c9174f7e031fdb890e8d1550ae4..a2a44b875a02db284d0f67eb9a20506622da2257:/test/python/api/test_server_glue_v1.py diff --git a/test/python/api/test_server_glue_v1.py b/test/python/api/test_server_glue_v1.py index fe406c42..5716f245 100644 --- a/test/python/api/test_server_glue_v1.py +++ b/test/python/api/test_server_glue_v1.py @@ -2,7 +2,7 @@ # # This file is part of Nominatim. (https://nominatim.org) # -# Copyright (C) 2023 by the Nominatim developer community. +# Copyright (C) 2024 by the Nominatim developer community. # For a full list of authors see the git log. """ Tests for the Python web frameworks adaptor, v1 API. @@ -15,9 +15,9 @@ import pytest from fake_adaptor import FakeAdaptor, FakeError, FakeResponse -import nominatim.api.v1.server_glue as glue -import nominatim.api as napi -import nominatim.api.logging as loglib +import nominatim_api.v1.server_glue as glue +import nominatim_api as napi +import nominatim_api.logging as loglib # ASGIAdaptor.get_int/bool() @@ -67,7 +67,7 @@ def test_adaptor_parse_format_use_configured(): adaptor = FakeAdaptor(params={'format': 'json'}) assert adaptor.parse_format(napi.StatusResult, 'text') == 'json' - assert adaptor.content_type == 'application/json' + assert adaptor.content_type == 'application/json; charset=utf-8' def test_adaptor_parse_format_invalid_value(): @@ -132,7 +132,7 @@ class TestAdaptorRaiseError: def test_json(self): - self.adaptor.content_type = 'application/json' + self.adaptor.content_type = 'application/json; charset=utf-8' err = self.run_raise_error('TEST', 501) @@ -189,7 +189,7 @@ def test_build_response_with_status(): assert isinstance(resp, FakeResponse) assert resp.status == 404 assert resp.output == 'stuff\nmore stuff' - assert resp.content_type == 'application/json' + assert resp.content_type == 'application/json; charset=utf-8' def test_build_response_jsonp_with_json(): @@ -201,7 +201,7 @@ def test_build_response_jsonp_with_json(): assert isinstance(resp, FakeResponse) assert resp.status == 200 assert resp.output == 'test.func({})' - assert resp.content_type == 'application/javascript' + assert resp.content_type == 'application/javascript; charset=utf-8' def test_build_response_jsonp_without_json(): @@ -270,7 +270,7 @@ class TestStatusEndpoint: assert isinstance(resp, FakeResponse) assert resp.status == 200 - assert resp.content_type == 'application/json' + assert resp.content_type == 'application/json; charset=utf-8' @pytest.mark.asyncio