Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed May 13, 2024
1 parent 88523f5 commit 4ae83a6
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions felt/test/test_fsl_conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -861,8 +861,9 @@ def test_filled_marker(self):
fill_symbol = QgsFillSymbol()
fill = QgsSimpleFillSymbolLayer(color=QColor(255, 0, 0))

# no brush
# no brush, no stroke
fill.setBrushStyle(Qt.NoBrush)
fill.setStrokeStyle(Qt.NoPen)
fill_symbol.changeSymbolLayer(0, fill.clone())
marker = QgsFilledMarkerSymbolLayer()
marker.setSubSymbol(fill_symbol.clone())
Expand All @@ -883,6 +884,16 @@ def test_filled_marker(self):
fill.setStrokeWidth(3)
fill_symbol.changeSymbolLayer(0, fill.clone())
marker.setSubSymbol(fill_symbol.clone())
self.assertEqual(
FslConverter.filled_marker_to_fsl(marker, conversion_context),
[{'color': 'rgb(0, 255, 0)',
'size': 4,
'strokeColor': 'rgba(0, 0, 0, 0)'}]
)

fill.setStrokeStyle(Qt.SolidLine)
fill_symbol.changeSymbolLayer(0, fill.clone())
marker.setSubSymbol(fill_symbol.clone())
self.assertEqual(
FslConverter.filled_marker_to_fsl(marker, conversion_context),
[{'color': 'rgb(0, 255, 0)',
Expand Down Expand Up @@ -1962,8 +1973,7 @@ def test_convert_singleband_pseudocolor(self):
'steps': [50.0, 120.0, 125.0, 130.0]},
'legend': {
'displayName': {'0': 'lowest', '1': 'mid', '2': 'highest'}},
'style': {'color': ['rgb(0, 255, 0)', 'rgb(255, 255, 0)',
'rgb(0, 255, 255)'],
'style': {'color': ['#00ff00', '#ffff00', '#00ffff'],
'isSandwiched': False,
'opacity': 1},
'type': 'numeric'}
Expand All @@ -1981,13 +1991,13 @@ def test_convert_singleband_pseudocolor(self):
'steps': [50.0, 120.0, 125.0, 130.0]},
'legend': {
'displayName': {'0': 'lowest', '1': 'mid', '2': 'highest'}},
'style': {'color': ['rgb(0, 255, 0)', 'rgb(255, 255, 0)',
'rgb(0, 255, 255)'],
'style': {'color': ['#00ff00', '#ffff00', '#00ffff'],
'isSandwiched': False,
'opacity': 1},
'type': 'numeric'}
)

@unittest.skip('Broken API, disabled for now')
def test_convert_paletted_raster(self):
"""
Convert raster paletted renderer
Expand Down

0 comments on commit 4ae83a6

Please sign in to comment.