diff --git a/tests/src/python/test_qgsmapboxglconverter.py b/tests/src/python/test_qgsmapboxglconverter.py index 34e11e66ab07..a6d8a02aea3c 100644 --- a/tests/src/python/test_qgsmapboxglconverter.py +++ b/tests/src/python/test_qgsmapboxglconverter.py @@ -491,62 +491,13 @@ def testParseExpression(self): self.assertEqual(QgsMapBoxGlStyleConverter.parseExpression(["in", ["get", "subclass"], ["literal", ["allotments", "forest", "glacier"]]], conversion_context, True), '''"subclass" IN ('allotments', 'forest', 'glacier')''') # fix last (default) value of a match can be a match - self.assertEqual(QgsMapBoxGlStyleConverter.parseExpression( - [ - "match", - [ - "get", - "is_route" - ], - [ - 5, - 10 - ], - "hsl(16,91%,80%)", - [ - 6, - 7, - 8 - ], - "hsl(55,91%,80%)", - [ - "match", - [ - "get", - "class" - ], - [ - "motorway", - "trunk", - "motorway_construction", - "trunk_construction" - ], - "hsl(41,93%,73%)", - [ - "rail", - "rail_construction", - "path", - "path_construction", - "footway", - "footway_construction", - "track", - "track_construction", - "trail", - "trail_construction" - ], - [ - "match", - [ - "get", - "subclass" - ], - "covered_bridge", - "rgb(255,255,255)", - "rgb(238,238,240)" - ], - "rgba(255,255,255,1)" - ] - ], conversion_context, True), '''CASE WHEN "is_route" IN (5,10) THEN '#fab69e' WHEN "is_route" IN (6,7,8) THEN '#faf39e' ELSE CASE WHEN "class" IN ('motorway','trunk','motorway_construction','trunk_construction') THEN '#fad27a' WHEN "class" IN ('rail','rail_construction','path','path_construction','footway','footway_construction','track','track_construction','trail','trail_construction') THEN '#000000' ELSE '#ffffff' END END''') + self.assertEqual( + QgsMapBoxGlStyleConverter.parseExpression( + ["match", ["get", "is_route"], [5, 10], "hsl(16,91%,80%)", [6, 7, 8], "hsl(55,91%,80%)", ["match", ["get", "class"], ["motorway", "trunk", "motorway_construction", "trunk_construction"], "hsl(41,93%,73%)", ["rail", "rail_construction", "path", "path_construction", "footway", "footway_construction", "track", "track_construction", "trail", "trail_construction"], ["match", ["get", "subclass"], "covered_bridge", "rgb(255,255,255)", "rgb(238,238,240)"], "rgba(255,255,255,1)"]], + conversion_context, True + ), + '''CASE WHEN "is_route" IN (5, 10) THEN color_rgba(250,182,158,255) WHEN "is_route" IN (6, 7, 8) THEN color_rgba(250,243,158,255) ELSE CASE WHEN "class" IN ('motorway', 'trunk', 'motorway_construction', 'trunk_construction') THEN color_rgba(250,210,122,255) WHEN "class" IN ('rail', 'rail_construction', 'path', 'path_construction', 'footway', 'footway_construction', 'track', 'track_construction', 'trail', 'trail_construction') THEN CASE WHEN ("subclass" = 'covered_bridge') THEN color_rgba(255,255,255,255) ELSE color_rgba(238,238,240,255) END ELSE color_rgba(255,255,255,255) END END''' + ) def testConvertLabels(self): context = QgsMapBoxGlStyleConversionContext()