mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-27 00:33:48 -05:00
Indentation
This commit is contained in:
parent
d3aae3f5b6
commit
c71347c327
@ -55,25 +55,29 @@ class TestQgsSvgCache(unittest.TestCase):
|
|||||||
def testRemoteSVG(self):
|
def testRemoteSVG(self):
|
||||||
"""Test fetching remote svg."""
|
"""Test fetching remote svg."""
|
||||||
url = 'http://localhost:{}/qgis_local_server/sample_svg.svg'.format(str(TestQgsSvgCache.port))
|
url = 'http://localhost:{}/qgis_local_server/sample_svg.svg'.format(str(TestQgsSvgCache.port))
|
||||||
image, in_cache = QgsApplication.svgCache().svgAsImage(url, 100, fill=QColor(0, 0, 0), stroke=QColor(0, 0, 0), strokeWidth=0.1, widthScaleFactor=1)
|
image, in_cache = QgsApplication.svgCache().svgAsImage(url, 100, fill=QColor(0, 0, 0), stroke=QColor(0, 0, 0),
|
||||||
|
strokeWidth=0.1, widthScaleFactor=1)
|
||||||
self.assertTrue(self.imageCheck('Remote SVG', 'remote_svg', image))
|
self.assertTrue(self.imageCheck('Remote SVG', 'remote_svg', image))
|
||||||
|
|
||||||
def testRemoteSvgAsText(self):
|
def testRemoteSvgAsText(self):
|
||||||
"""Test fetching remote svg with text mime format - e.g. github raw svgs"""
|
"""Test fetching remote svg with text mime format - e.g. github raw svgs"""
|
||||||
url = 'http://localhost:{}/qgis_local_server/svg_as_text.txt'.format(str(TestQgsSvgCache.port))
|
url = 'http://localhost:{}/qgis_local_server/svg_as_text.txt'.format(str(TestQgsSvgCache.port))
|
||||||
image, in_cache = QgsApplication.svgCache().svgAsImage(url, 100, fill=QColor(0, 0, 0), stroke=QColor(0, 0, 0), strokeWidth=0.1, widthScaleFactor=1)
|
image, in_cache = QgsApplication.svgCache().svgAsImage(url, 100, fill=QColor(0, 0, 0), stroke=QColor(0, 0, 0),
|
||||||
|
strokeWidth=0.1, widthScaleFactor=1)
|
||||||
self.assertTrue(self.imageCheck('Remote SVG as Text', 'remote_svg', image))
|
self.assertTrue(self.imageCheck('Remote SVG as Text', 'remote_svg', image))
|
||||||
|
|
||||||
def testRemoteSvgBadMime(self):
|
def testRemoteSvgBadMime(self):
|
||||||
"""Test fetching remote svg with bad mime type"""
|
"""Test fetching remote svg with bad mime type"""
|
||||||
url = 'http://localhost:{}/qgis_local_server/logo.png'.format(str(TestQgsSvgCache.port))
|
url = 'http://localhost:{}/qgis_local_server/logo.png'.format(str(TestQgsSvgCache.port))
|
||||||
image, in_cache = QgsApplication.svgCache().svgAsImage(url, 100, fill=QColor(0, 0, 0), stroke=QColor(0, 0, 0), strokeWidth=0.1, widthScaleFactor=1)
|
image, in_cache = QgsApplication.svgCache().svgAsImage(url, 100, fill=QColor(0, 0, 0), stroke=QColor(0, 0, 0),
|
||||||
|
strokeWidth=0.1, widthScaleFactor=1)
|
||||||
self.assertTrue(self.imageCheck('Remote SVG bad MIME type', 'bad_svg', image))
|
self.assertTrue(self.imageCheck('Remote SVG bad MIME type', 'bad_svg', image))
|
||||||
|
|
||||||
def testRemoteSvgMissing(self):
|
def testRemoteSvgMissing(self):
|
||||||
"""Test fetching remote svg with bad url"""
|
"""Test fetching remote svg with bad url"""
|
||||||
url = 'http://localhost:{}/qgis_local_server/xxx.svg'.format(str(TestQgsSvgCache.port)) # oooo naughty
|
url = 'http://localhost:{}/qgis_local_server/xxx.svg'.format(str(TestQgsSvgCache.port)) # oooo naughty
|
||||||
image, in_cache = QgsApplication.svgCache().svgAsImage(url, 100, fill=QColor(0, 0, 0), stroke=QColor(0, 0, 0), strokeWidth=0.1, widthScaleFactor=1)
|
image, in_cache = QgsApplication.svgCache().svgAsImage(url, 100, fill=QColor(0, 0, 0), stroke=QColor(0, 0, 0),
|
||||||
|
strokeWidth=0.1, widthScaleFactor=1)
|
||||||
self.assertTrue(self.imageCheck('Remote SVG missing', 'bad_svg', image))
|
self.assertTrue(self.imageCheck('Remote SVG missing', 'bad_svg', image))
|
||||||
|
|
||||||
def imageCheck(self, name, reference_image, image):
|
def imageCheck(self, name, reference_image, image):
|
||||||
@ -91,5 +95,6 @@ class TestQgsSvgCache(unittest.TestCase):
|
|||||||
print((self.report))
|
print((self.report))
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user