Skip to content

Commit

Permalink
Add unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pblottiere authored and rldhont committed May 2, 2018
1 parent 1636e6a commit 4962953
Show file tree
Hide file tree
Showing 3 changed files with 929 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/src/python/test_qgsserver_wms.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,23 @@ def test_project_wms_inspire(self):
for request in ('GetCapabilities',):
self.wms_inspire_request_compare(request)

def test_wms_getcapabilities_without_title(self):
# Empty title in project leads to a Layer element without Name, Title
# and Abstract tags. However, it should still have a CRS and a BBOX
# according to OGC specifications tests.
project = os.path.join(self.testdata_path, "test_project_without_title.qgs")
qs = "?" + "&".join(["%s=%s" % i for i in list({
"MAP": urllib.parse.quote(project),
"SERVICE": "WMS",
"VERSION": "1.3.0",
"REQUEST": "GetCapabilities",
"STYLES": ""
}.items())])

r, h = self._result(self._execute_request(qs))

self.wms_request_compare('GetCapabilities', reference_file='wms_getcapabilities_without_title', project='test_project_without_title.qgs')

def test_wms_getcapabilities_url(self):
# empty url in project
project = os.path.join(self.testdata_path, "test_project_without_urls.qgs")
Expand Down

3 comments on commit 4962953

@m-kuhn
Copy link
Member

@m-kuhn m-kuhn commented on 4962953 May 3, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this unit test is failing: https://travis-ci.org/qgis/QGIS/jobs/374124060#L1537

@pblottiere
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, due to an early backport. The PR #6926 fixes the issue.

@m-kuhn
Copy link
Member

@m-kuhn m-kuhn commented on 4962953 May 3, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, ok. I was just wondering why my backport was failing repeatedly. I'll wait for this one.

Please sign in to comment.