From 2b2fbd67f3368b3fa6cfa80a60ed04d7ce71e085 Mon Sep 17 00:00:00 2001 From: Lina Krisztian Date: Tue, 21 Nov 2023 14:32:33 +0100 Subject: [PATCH] add test for importer --- tests/test_raster_import_pixellimit.py | 46 ++++++++++++++++++++++++-- 1 file changed, 44 insertions(+), 2 deletions(-) diff --git a/tests/test_raster_import_pixellimit.py b/tests/test_raster_import_pixellimit.py index 63b382947..779364d36 100644 --- a/tests/test_raster_import_pixellimit.py +++ b/tests/test_raster_import_pixellimit.py @@ -66,7 +66,8 @@ def tearDown(self): def test_pixellimit_allowed(self): """ - Test import of raster, for which pixellimit is not reached and therefore allowed + Test import of raster, for which pixellimit is not reached + and therefore allowed """ raster_url = additional_external_data[self.rimport_inp] raster = self.rimport_inp @@ -105,7 +106,8 @@ def test_pixellimit_allowed(self): def test_pixellimit_not_allowed(self): """ - Test import of raster, for which pixellimit is reached and therefore not allowed + Test import of raster, for which pixellimit is reached + and therefore not allowed """ raster_url = additional_external_data[self.rimport_inp] raster = self.rimport_inp @@ -154,6 +156,46 @@ def test_pixellimit_not_allowed(self): in resp["exception"]["message"] ) + def test_pixellimit_importer(self): + """ + Test import of raster with the importer + with pixellimit not reached and therefore allowed + """ + raster_url = additional_external_data[self.rimport_inp] + raster = self.rimport_inp + process_chain = { + "version": 1, + "list": [ + { + "id": "1", + "module": "importer", + "inputs": [ + { + "import_descr": { + "source": raster_url, + "type": "raster", + }, + "param": "map", + "value": raster, + }, + ], + }, + ], + } + rv = self.server.post( + URL_PREFIX + self.endpoint, + headers=self.admin_auth_header, + data=json_dumps(process_chain), + content_type="application/json", + ) + # Import should succeed + self.waitAsyncStatusAssertHTTP( + rv, + headers=self.admin_auth_header, + http_status=200, + status="finished", + ) + if __name__ == "__main__": unittest.main()