Skip to content
Permalink
Browse files

Spelling, doc and indentation

  • Loading branch information
mhugent committed Jan 2, 2019
1 parent a145847 commit 14935745f666129044eb67e1a1a26c6fd62d4c7a
@@ -1149,7 +1149,7 @@ namespace QgsWms
*/
QString layoutParameter( const QString &id, bool &ok ) const;

//! Return ATLAS_ID parameter
//! Returns the ATLAS_PK parameter
QStringList atlasPk() const;

private:
@@ -400,7 +400,7 @@ namespace QgsWms
if ( pkIndexes.size() < 1 )
{
throw QgsBadRequestException( QStringLiteral( "AtlasPrintError" ),
QStringLiteral( "An error occured during the Atlas print" ) );
QStringLiteral( "An error occurred during the Atlas print" ) );
}
QStringList pkAttributeNames;
for ( int i = 0; i < pkIndexes.size(); ++i )
@@ -445,7 +445,7 @@ namespace QgsWms
if ( !errorString.isEmpty() )
{
throw QgsBadRequestException( QStringLiteral( "AtlasPrintError" ),
QStringLiteral( "An error occured during the Atlas print" ) );
QStringLiteral( "An error occurred during the Atlas print" ) );
}
}

@@ -282,7 +282,13 @@ namespace QgsWms
//! Gets layer search rectangle (depending on request parameter, layer type, map and layer crs)
QgsRectangle featureInfoSearchRect( QgsVectorLayer *ml, const QgsMapSettings &ms, const QgsRenderContext &rct, const QgsPointXY &infoPoint ) const;

//! configure the print layout for the GetPrint request
/*
* Configure the print layout for the GetPrint request
* @param c the print layout
* @param mapSettings the map settings
* @param atlasPrint true if atlas is used for printing
* @return true in case of success
* */
bool configurePrintLayout( QgsPrintLayout *c, const QgsMapSettings &mapSettings, bool atlasPrint = false );

//! Creates external WMS layer. Caller takes ownership
@@ -412,31 +412,32 @@ def test_wms_getprint_two_maps(self):
r, h = self._result(self._execute_request(qs))
self._img_diff_error(r, h, "WMS_GetPrint_TwoMaps")

def test_wms_getprint_atlas( self ):
qs = "?" + "&".join(["%s=%s" % i for i in list({
"MAP": urllib.parse.quote(self.projectPath),
"SERVICE": "WMS",
"VERSION": "1.3.0",
"REQUEST": "GetPrint",
"TEMPLATE": "layoutA4",
"FORMAT": "png",
"CRS": "EPSG:3857",
"ATLAS_PK": "3",
"map0:LAYERS": "Country,Hello",
def test_wms_getprint_atlas(self):
qs = "?" + "&".join(["%s=%s" % i for i in list({
"MAP": urllib.parse.quote(self.projectPath),
"SERVICE": "WMS",
"VERSION": "1.3.0",
"REQUEST": "GetPrint",
"TEMPLATE": "layoutA4",
"FORMAT": "png",
"CRS": "EPSG:3857",
"ATLAS_PK": "3",
"map0:LAYERS": "Country,Hello",
}.items())])
r, h = self._result(self._execute_request(qs))
self._img_diff_error(r, h, "WMS_GetPrint_Atlas")
r, h = self._result(self._execute_request(qs))
self._img_diff_error(r, h, "WMS_GetPrint_Atlas")

def test_wms_getprint_atlas_getProjectSettings( self ):
qs = "?" + "&".join(["%s=%s" % i for i in list({
"MAP": urllib.parse.quote(self.projectPath),
"SERVICE": "WMS",
"VERSION": "1.3.0",
"REQUEST": "GetProjectSettings",
def test_wms_getprint_atlas_getProjectSettings(self):
qs = "?" + "&".join(["%s=%s" % i for i in list({
"MAP": urllib.parse.quote(self.projectPath),
"SERVICE": "WMS",
"VERSION": "1.3.0",
"REQUEST": "GetProjectSettings",
}.items())])
r, h = self._result(self._execute_request(qs))
self.assertTrue( 'atlasEnabled="1"' in str( r ) )
self.assertTrue( '<PrimaryKeyAttribute>' in str( r ) )
r, h = self._result(self._execute_request(qs))
self.assertTrue('atlasEnabled="1"' in str(r))
self.assertTrue('<PrimaryKeyAttribute>' in str(r))


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

0 comments on commit 1493574

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