Skip to content

Commit

Permalink
add test for importer
Browse files Browse the repository at this point in the history
  • Loading branch information
linakrisztian committed Nov 21, 2023
1 parent f638315 commit 2b2fbd6
Showing 1 changed file with 44 additions and 2 deletions.
46 changes: 44 additions & 2 deletions tests/test_raster_import_pixellimit.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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()

0 comments on commit 2b2fbd6

Please sign in to comment.