Skip to content

Commit

Permalink
[Server] Add GetProjectSettings tests in AccessControl test
Browse files Browse the repository at this point in the history
  • Loading branch information
rldhont committed May 20, 2017
1 parent a916bf4 commit e13e757
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions tests/src/python/test_qgsserver_accesscontrol.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,36 @@ def test_wms_getcapabilities(self):
str(response).find("<Name>Country</Name>") != -1,
"Country layer in GetCapabilities\n%s" % response)

def test_wms_getprojectsettings(self):
query_string = "&".join(["%s=%s" % i for i in {
"MAP": urllib.quote(self.projectPath),
"SERVICE": "WMS",
"VERSION": "1.1.1",
"REQUEST": "GetProjectSettings"
}.items()])

response, headers = self._get_fullaccess(query_string)
self.assertTrue(
str(response).find("<TreeName>Hello</TreeName>") != -1,
"No Hello layer in GetProjectSettings\n%s" % response)
self.assertTrue(
str(response).find("<TreeName>Country</TreeName>") != -1,
"No Country layer in GetProjectSettings\n%s" % response)
self.assertTrue(
str(response).find("<LayerDrawingOrder>Country_Labels,Country,dem,Hello_Filter_SubsetString,Hello_Project_SubsetString,Hello_SubsetString,Hello,db_point</LayerDrawingOrder>") != -1,
"LayerDrawingOrder in GetProjectSettings\n%s" % response)

response, headers = self._get_restricted(query_string)
self.assertTrue(
str(response).find("<TreeName>Hello</TreeName>") != -1,
"No Hello layer in GetProjectSettings\n%s" % response)
self.assertFalse(
str(response).find("<TreeName>Country</TreeName>") != -1,
"Country layer in GetProjectSettings\n%s" % response)
self.assertTrue(
str(response).find("<LayerDrawingOrder>Country_Labels,dem,Hello_Filter_SubsetString,Hello_Project_SubsetString,Hello_SubsetString,Hello,db_point</LayerDrawingOrder>") != -1,
"LayerDrawingOrder in GetProjectSettings\n%s" % response)

def test_wms_describelayer_hello(self):
query_string = "&".join(["%s=%s" % i for i in {
"MAP": urllib.quote(self.projectPath),
Expand Down

0 comments on commit e13e757

Please sign in to comment.