commit 79f24997662133e3aa0bdd2ecbd6541b3fba08c1
parent 9e3241ac3615a3d7c84301ce1e9c25636907f133
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date: Fri, 15 May 2026 18:13:42 +0200
test(mocked-qgis): add Opacity field to mocked field type and feature attribute tests
Diffstat:
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/test/test_core.py b/test/test_core.py
@@ -646,6 +646,7 @@ class PluginTests(unittest.TestCase):
"StationNo": "1_00001",
"NumLayers": 30,
"Layer": 1,
+ "Opacity": 100,
"Color": "#00ff00",
"Geometry": "POINT Z (1 2 3)",
}
@@ -655,7 +656,7 @@ class PluginTests(unittest.TestCase):
self.assertEqual(
[field.name() for field in fields],
- ["X", "Line", "StationNo", "NumLayers", "Layer", "Color"],
+ ["X", "Line", "StationNo", "NumLayers", "Layer", "Opacity", "Color"],
)
self.assertEqual(
[field.field_type for field in fields],
@@ -665,6 +666,7 @@ class PluginTests(unittest.TestCase):
module.QMetaType.Type.QString,
module.QMetaType.Type.Int,
module.QMetaType.Type.Int,
+ module.QMetaType.Type.Int,
module.QMetaType.Type.QString,
],
)
@@ -693,6 +695,7 @@ class PluginTests(unittest.TestCase):
"X": 1.0,
"Y": 2.0,
"Layer": 1,
+ "Opacity": 10,
"Color": "#00ff00",
"Geometry": "LINESTRING Z (1 2 3, 1 2 2)",
}
@@ -730,7 +733,7 @@ class PluginTests(unittest.TestCase):
)
self.assertEqual(
writer.features[0].attributes,
- [1.0, 2.0, 1, "#00ff00"],
+ [1.0, 2.0, 1, 10, "#00ff00"],
)
def test_write_geopackage_layer_reports_writer_error(self):
@@ -788,6 +791,7 @@ class PluginTests(unittest.TestCase):
"DepthTop": 0.0,
"DepthBottom": 1.0,
"Resistivity": 10.0,
+ "Opacity": 100,
"Color": "#008cff",
"Layer": 1,
"Geometry": "LINESTRING Z (1 2 3, 1 2 2)",