summaryrefslogtreecommitdiffstats
path: root/share/extensions/tests/test_interp_att_g.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 18:24:48 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 18:24:48 +0000
commitcca66b9ec4e494c1d919bff0f71a820d8afab1fa (patch)
tree146f39ded1c938019e1ed42d30923c2ac9e86789 /share/extensions/tests/test_interp_att_g.py
parentInitial commit. (diff)
downloadinkscape-12fc8abae6d434cac7670a59ed3a67301cc2eb10.tar.xz
inkscape-12fc8abae6d434cac7670a59ed3a67301cc2eb10.zip
Adding upstream version 1.2.2.upstream/1.2.2upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'share/extensions/tests/test_interp_att_g.py')
-rw-r--r--share/extensions/tests/test_interp_att_g.py67
1 files changed, 67 insertions, 0 deletions
diff --git a/share/extensions/tests/test_interp_att_g.py b/share/extensions/tests/test_interp_att_g.py
new file mode 100644
index 0000000..4f07e52
--- /dev/null
+++ b/share/extensions/tests/test_interp_att_g.py
@@ -0,0 +1,67 @@
+#!/usr/bin/env python
+# coding=utf-8
+from interp_att_g import InterpAttG
+from inkex.tester import ComparisonMixin, TestCase
+
+
+class InterpAttGBasicTest(ComparisonMixin, TestCase):
+ effect_class = InterpAttG
+ comparisons = [("--id=layer1", "--att=style/fill")]
+
+
+class InterpAttGMultipleSelectedTest(ComparisonMixin, TestCase):
+ effect_class = InterpAttG
+ comparisons = [("--id=c1", "--id=c2", "--id=c3", "--att=style/fill")]
+
+
+class InterpAttGColorRoundingTest(ComparisonMixin, TestCase):
+ effect_class = InterpAttG
+ compare_file = "svg/group_interpolate.svg"
+ comparisons = [
+ # test for truncating/rounding bug inbox#1892
+ ("--id=g53", "--att=style/fill", "--start-val=#181818", "--end-val=#000000"),
+ # test for clipping of values <= 1
+ ("--id=g53", "--att=style/fill", "--start-val=#050505", "--end-val=#000000"),
+ ]
+
+
+class InterpAttGOtherAttributeTest(ComparisonMixin, TestCase):
+ # interpolate other values (test base.arg_class)
+ effect_class = InterpAttG
+ compare_file = "svg/group_interpolate.svg"
+ comparisons = [
+ (
+ "--id=g53",
+ "--att=other",
+ "--att-other=width",
+ "--start-val=5",
+ "--end-val=10",
+ "--att-other-type=ValueInterpolator",
+ ),
+ (
+ "--id=g53",
+ "--att=other",
+ "--att-other=fill",
+ "--att-other-where=style",
+ "--start-val=red",
+ "--end-val=green",
+ "--att-other-type=ColorInterpolator",
+ ),
+ ]
+
+
+class InterpAttGTransformInterpolateTest(ComparisonMixin, TestCase):
+ effect_class = InterpAttG
+ compare_file = "svg/group_interpolate.svg"
+ comparisons = [
+ ("--id=g53", "--att=transform/scale", "--start-val=0.2", "--end-val=0.9"),
+ ("--id=g53", "--att=transform/trans-x", "--start-val=0", "--end-val=20"),
+ ]
+
+
+class InterpAttGUnitsTest(ComparisonMixin, TestCase):
+ effect_class = InterpAttG
+ compare_file = "svg/group_interpolate.svg"
+ comparisons = [
+ ("--id=g53", "--att=width", "--start-val=0.02", "--end-val=0.1", "--unit=mm")
+ ]