Skip to content

Commit

Permalink
Tests - Clean test file expression service
Browse files Browse the repository at this point in the history
  • Loading branch information
Gustry committed Apr 29, 2024
1 parent 98e604b commit bff7bef
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 17 deletions.
25 changes: 12 additions & 13 deletions test/test_expression_service.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import json
from test.utils import _build_query_string, _check_request

__copyright__ = 'Copyright 2019, 3Liz'
__license__ = 'GPL version 3'
__email__ = '[email protected]'
__revision__ = '$Format:%H$'


def test_request_unknown(client):
Expand All @@ -12,16 +11,16 @@ def test_request_unknown(client):
projectfile = "france_parts.qgs"

# Make a request
qs = "?SERVICE=EXPRESSION&REQUEST=UNKNOWN_REQUEST&MAP=france_parts.qgs"
rv = client.get(qs, projectfile)
assert rv.status_code == 400

assert rv.headers.get('Content-Type', '').find('application/json') == 0

b = json.loads(rv.content.decode('utf-8'))

assert ('status' in b)
qs = {
"SERVICE": "EXPRESSION",
"REQUEST": "UNKNOWN_REQUEST",
"MAP": "france_parts.qgs",
}
rv = client.get(_build_query_string(qs), projectfile)
b = _check_request(rv, http_code=400)

assert 'status' in b
assert b['status'] == 'fail'

assert ('code' in b)
assert ('message' in b)
assert 'code' in b
assert 'message' in b
1 change: 0 additions & 1 deletion test/test_expression_service_evaluate.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
__copyright__ = 'Copyright 2019, 3Liz'
__license__ = 'GPL version 3'
__email__ = '[email protected]'
__revision__ = '$Format:%H$'


def test_layer_error(client):
Expand Down
1 change: 0 additions & 1 deletion test/test_expression_service_virtualfields.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
__copyright__ = 'Copyright 2019, 3Liz'
__license__ = 'GPL version 3'
__email__ = '[email protected]'
__revision__ = '$Format:%H$'


def test_layer_error(client):
Expand Down
1 change: 0 additions & 1 deletion test/test_lizmap_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
__copyright__ = 'Copyright 2019, 3Liz'
__license__ = 'GPL version 3'
__email__ = '[email protected]'
__revision__ = '$Format:%H$'


def test_no_lizmap_config(client):
Expand Down
1 change: 0 additions & 1 deletion test/test_lizmap_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
__copyright__ = 'Copyright 2019, 3Liz'
__license__ = 'GPL version 3'
__email__ = '[email protected]'
__revision__ = '$Format:%H$'


def test_lizmap_request_unknown(client):
Expand Down

0 comments on commit bff7bef

Please sign in to comment.