Skip to content

Commit

Permalink
Add unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
pblottiere committed Feb 4, 2022
1 parent 786c675 commit 8c5fa81
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions tests/src/python/test_qgsserver_wfs.py
Expand Up @@ -131,6 +131,31 @@ def wfs_getfeature_compare(self, requestid, request):
header, body
)

def test_getfeature_invalid_typename(self):
project = self.testdata_path + "test_project_wfs.qgs"

# a single invalid typename
qs = "?" + "&".join(["%s=%s" % i for i in list({
"MAP": urllib.parse.quote(project),
"SERVICE": "WFS",
"REQUEST": "GetFeature",
"TYPENAME": "invalid"
}.items())])
header, body = self._execute_request(qs)

self.assertTrue(b"TypeName 'invalid' unknown" in body)

# an invalid typename preceded by a valid one
qs = "?" + "&".join(["%s=%s" % i for i in list({
"MAP": urllib.parse.quote(project),
"SERVICE": "WFS",
"REQUEST": "GetFeature",
"TYPENAME": "testlayer,invalid"
}.items())])
header, body = self._execute_request(qs)

self.assertTrue(b"TypeName 'invalid' unknown" in body)

def test_getfeature(self):

tests = []
Expand Down

0 comments on commit 8c5fa81

Please sign in to comment.