Skip to content
Permalink
Browse files

[Server] Fixing spelling and doc coverage

  • Loading branch information
rldhont committed Aug 1, 2018
1 parent 9463d04 commit 65f9c91e8ef390bcfc7874549d7844d2b3cdeb17
@@ -37,6 +37,7 @@ class QgsServerInterface;
* \ingroup server
* \class QgsServerCacheFilter
* \brief Class defining cache interface for QGIS Server plugins.
* \since QGIS 3.4
*/
class SERVER_EXPORT QgsServerCacheFilter
{
@@ -56,7 +57,7 @@ class SERVER_EXPORT QgsServerCacheFilter
* Returns cached document (or 0 if document not in cache) like capabilities
* \param project the project used to generate the document to provide path
* \param request the request used to generate the document to provider parameters or data
* \param key the key provided by the access control to identify differents documents for the same request
* \param key the key provided by the access control to identify different documents for the same request
* \returns QByteArray of the cached document or an empty one if no corresponding document found
*/
virtual QByteArray getCachedDocument( const QgsProject *project, const QgsServerRequest &request, const QString &key ) const;
@@ -66,7 +67,7 @@ class SERVER_EXPORT QgsServerCacheFilter
* \param doc the document to cache
* \param project the project used to generate the document to provide path
* \param request the request used to generate the document to provider parameters or data
* \param key the key provided by the access control to identify differents documents for the same request
* \param key the key provided by the access control to identify different documents for the same request
* \returns true if the document has been cached
*/
virtual bool setCachedDocument( const QDomDocument *doc, const QgsProject *project, const QgsServerRequest &request, const QString &key ) const;
@@ -75,7 +76,7 @@ class SERVER_EXPORT QgsServerCacheFilter
* Deletes the cached document
* \param project the project used to generate the document to provide path
* \param request the request used to generate the document to provider parameters or data
* \param key the key provided by the access control to identify differents documents for the same request
* \param key the key provided by the access control to identify different documents for the same request
* \returns true if the document has been deleted
*/
virtual bool deleteCachedDocument( const QgsProject *project, const QgsServerRequest &request, const QString &key ) const;
@@ -91,7 +92,7 @@ class SERVER_EXPORT QgsServerCacheFilter
* Returns cached image (or 0 if document not in cache) like tiles
* \param project the project used to generate the image to provide path
* \param request the request used to generate the image to provider parameters or data
* \param key the key provided by the access control to identify differents images for the same request
* \param key the key provided by the access control to identify different images for the same request
* \returns QByteArray of the cached image or an empty one if no corresponding image found
*/
virtual QByteArray getCachedImage( const QgsProject *project, const QgsServerRequest &request, const QString &key ) const;
@@ -101,7 +102,7 @@ class SERVER_EXPORT QgsServerCacheFilter
* \param img the document to cache
* \param project the project used to generate the image to provide path
* \param request the request used to generate the image to provider parameters or data
* \param key the key provided by the access control to identify differents images for the same request
* \param key the key provided by the access control to identify different images for the same request
* \returns true if the image has been cached
*/
virtual bool setCachedImage( const QByteArray *img, const QgsProject *project, const QgsServerRequest &request, const QString &key ) const;
@@ -110,7 +111,7 @@ class SERVER_EXPORT QgsServerCacheFilter
* Deletes the cached image
* \param project the project used to generate the image to provide path
* \param request the request used to generate the image to provider parameters or data
* \param key the key provided by the access control to identify differents images for the same request
* \param key the key provided by the access control to identify different images for the same request
* \returns true if the image has been deleted
*/
virtual bool deleteCachedImage( const QgsProject *project, const QgsServerRequest &request, const QString &key ) const;
@@ -70,7 +70,7 @@ class SERVER_EXPORT QgsServerCacheManager
* Returns cached document (or 0 if document not in cache) like capabilities
* \param project the project used to generate the document to provide path
* \param request the request used to generate the document to provider parameters or data
* \param key the key provided by the access control to identify differents documents for the same request
* \param key the key provided by the access control to identify different documents for the same request
* \returns the cached document or 0 if no corresponding document found
*/
QByteArray getCachedDocument( const QgsProject *project, const QgsServerRequest &request, const QString &key ) const;
@@ -80,7 +80,7 @@ class SERVER_EXPORT QgsServerCacheManager
* \param doc the document to cache
* \param project the project used to generate the document to provide path
* \param request the request used to generate the document to provider parameters or data
* \param key the key provided by the access control to identify differents documents for the same request
* \param key the key provided by the access control to identify different documents for the same request
* \returns true if the document has been cached
*/
bool setCachedDocument( const QDomDocument *doc, const QgsProject *project, const QgsServerRequest &request, const QString &key ) const;
@@ -89,7 +89,7 @@ class SERVER_EXPORT QgsServerCacheManager
* Deletes the cached document
* \param project the project used to generate the document to provide path
* \param request the request used to generate the document to provider parameters or data
* \param key the key provided by the access control to identify differents documents for the same request
* \param key the key provided by the access control to identify different documents for the same request
* \returns true if the document has been deleted
*/
bool deleteCachedDocument( const QgsProject *project, const QgsServerRequest &request, const QString &key ) const;
@@ -105,7 +105,7 @@ class SERVER_EXPORT QgsServerCacheManager
* Returns cached image (or 0 if image not in cache) like tiles
* \param project the project used to generate the image to provide path
* \param request the request used to generate the image to provider parameters or data
* \param key the key provided by the access control to identify differents images for the same request
* \param key the key provided by the access control to identify different images for the same request
* \returns the cached image or 0 if no corresponding image found
*/
QByteArray getCachedImage( const QgsProject *project, const QgsServerRequest &request, const QString &key ) const;
@@ -115,7 +115,7 @@ class SERVER_EXPORT QgsServerCacheManager
* \param img the image to cache
* \param project the project used to generate the image to provide path
* \param request the request used to generate the image to provider parameters or data
* \param key the key provided by the access control to identify differents images for the same request
* \param key the key provided by the access control to identify different images for the same request
* \returns true if the image has been cached
*/
bool setCachedImage( const QByteArray *img, const QgsProject *project, const QgsServerRequest &request, const QString &key ) const;
@@ -124,7 +124,7 @@ class SERVER_EXPORT QgsServerCacheManager
* Deletes the cached image
* \param project the project used to generate the image to provide path
* \param request the request used to generate the image to provider parameters or data
* \param key the key provided by the access control to identify differents images for the same request
* \param key the key provided by the access control to identify different images for the same request
* \returns true if the image has been deleted
*/
bool deleteCachedImage( const QgsProject *project, const QgsServerRequest &request, const QString &key ) const;
@@ -216,7 +216,7 @@ namespace QgsWmts
serviceElem.appendChild( onlineResourceElem );
}

//Contact informations
//Contact information
QString contactPerson = QgsServerProjectUtils::owsServiceContactPerson( *project );
QString contactPosition = QgsServerProjectUtils::owsServiceContactPosition( *project );
QString contactMail = QgsServerProjectUtils::owsServiceContactMail( *project );
@@ -250,7 +250,7 @@ def test_getcapabilities(self):

cacheManager = self._server_iface.cacheManager()

self.assertTrue(cacheManager.deleteCachedDocuments(None), 'deleteCachedDocuments does not retrun True')
self.assertTrue(cacheManager.deleteCachedDocuments(None), 'deleteCachedDocuments does not return True')

filelist = [f for f in os.listdir(self._servercache._cache_dir) if f.endswith(".xml")]
self.assertEqual(len(filelist), 0, 'All files in cache are not deleted ')
@@ -275,7 +275,7 @@ def test_getcapabilities(self):
self.assertTrue(cDoc.setContent(cContent), 'cachedDocument not XML doc')
self.assertEqual(doc.documentElement().tagName(), cDoc.documentElement().tagName(), 'cachedDocument not equal to provide document')

self.assertTrue(cacheManager.deleteCachedDocuments(None), 'deleteCachedDocuments does not retrun True')
self.assertTrue(cacheManager.deleteCachedDocuments(None), 'deleteCachedDocuments does not return True')

def test_gettile(self):
project = self._project_path
@@ -386,7 +386,7 @@ def test_gettile(self):

cacheManager = self._server_iface.cacheManager()

self.assertTrue(cacheManager.deleteCachedImages(None), 'deleteCachedImages does not retrun True')
self.assertTrue(cacheManager.deleteCachedImages(None), 'deleteCachedImages does not return True')

filelist = [f for f in os.listdir(self._servercache._tile_cache_dir) if f.endswith(".png")]
self.assertEqual(len(filelist), 0, 'All images in cache are not deleted ')

0 comments on commit 65f9c91

Please sign in to comment.
You can’t perform that action at this time.