]> git.openstreetmap.org Git - nominatim.git/blobdiff - test/python/api/fake_adaptor.py
port unit tests to new python package layout
[nominatim.git] / test / python / api / fake_adaptor.py
index 1db8c72580a4baa3da1af9480549dda86b9449c0..50fbbbbea7cf8f702984e2a1837017a93855e68e 100644 (file)
@@ -2,15 +2,15 @@
 #
 # 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.
 """
 Provides dummy implementations of ASGIAdaptor for testing.
 """
 from collections import namedtuple
 
-import nominatim.api.v1.server_glue as glue
-from nominatim.config import Configuration
+import nominatim_api.v1.server_glue as glue
+from nominatim_core.config import Configuration
 
 class FakeError(BaseException):
 
@@ -43,10 +43,13 @@ class FakeAdaptor(glue.ASGIAdaptor):
         return FakeError(msg, status)
 
 
-    def create_response(self, status, output):
+    def create_response(self, status, output, num_results):
         return FakeResponse(status, output, self.content_type)
 
 
+    def base_uri(self) -> str:
+        return 'http://test'
+
     def config(self):
         return self._config