Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add a basic unit test
  • Loading branch information
pblottiere committed Jan 24, 2023
1 parent 5d78bbe commit 7e5f2e6
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/src/python/test_qgsserver_configcache.py
Expand Up @@ -199,6 +199,18 @@ def test_initialized_instance(self):

self.assertEqual(QgsConfigCache.instance().strategyName(), 'off')

def test_list_projects(self):
settings = QgsServerSettings()
settings.load()
cache = QgsConfigCache(settings)

path = Path(unitTestDataPath('qgis_server_project')) / 'project.qgs'
prj1 = cache.project(str(path))

projects = cache.projects()
self.assertEqual(len(projects), 1)
self.assertEqual(projects[0].fileName(), path.as_posix())


if __name__ == "__main__":
unittest.main()

0 comments on commit 7e5f2e6

Please sign in to comment.