mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-28 00:17:30 -05:00
Server landing page add test for empty projects
This commit is contained in:
parent
d0ffd56839
commit
0c34fc56ae
@ -154,6 +154,15 @@ class QgsServerLandingPageTest(QgsServerAPITestBase):
|
||||
self.compareApi(
|
||||
request, None, 'test_project_{}.json'.format(name.replace('.', '_')), subdir='landingpage')
|
||||
|
||||
def test_landing_page_json_empty(self):
|
||||
"""Test landing page in JSON format with no projects"""
|
||||
|
||||
os.environ['QGIS_SERVER_PROJECTS_DIRECTORIES'] = ''
|
||||
os.environ['QGIS_SERVER_PROJECTS_PG_CONNECTIONS'] = ''
|
||||
request = QgsBufferServerRequest('http://server.qgis.org/index.json')
|
||||
self.compareApi(
|
||||
request, None, 'test_landing_page_empty_index.json', subdir='landingpage')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
21
tests/testdata/qgis_server/landingpage/test_landing_page_empty_index.json
vendored
Normal file
21
tests/testdata/qgis_server/landingpage/test_landing_page_empty_index.json
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"links": [
|
||||
{
|
||||
"href": "http://server.qgis.org/index.json",
|
||||
"rel": "self",
|
||||
"title": "Landing page as JSON",
|
||||
"type": "application/json"
|
||||
},
|
||||
{
|
||||
"href": "http://server.qgis.org/index.html",
|
||||
"rel": "alternate",
|
||||
"title": "Landing page as HTML",
|
||||
"type": "text/html"
|
||||
}
|
||||
],
|
||||
"projects": [],
|
||||
"projects_count": 0,
|
||||
"timeStamp": "2019-07-05T12:27:07Z"
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user