summaryrefslogtreecommitdiffstats
path: root/share/extensions/tests/test_measure.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_measure.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_measure.py')
-rw-r--r--share/extensions/tests/test_measure.py33
1 files changed, 33 insertions, 0 deletions
diff --git a/share/extensions/tests/test_measure.py b/share/extensions/tests/test_measure.py
new file mode 100644
index 0000000..81f8b14
--- /dev/null
+++ b/share/extensions/tests/test_measure.py
@@ -0,0 +1,33 @@
+# coding=utf-8
+from inkex.utils import filename_arg
+from measure import MeasureLength
+from inkex.tester import ComparisonMixin, TestCase
+from inkex.tester.filters import CompareNumericFuzzy
+
+olddefaults = ("--fontsize=20", "--unit=mm", "--scale=1.1")
+
+
+class LengthBasicTest(ComparisonMixin, TestCase):
+ effect_class = MeasureLength
+ compare_filters = [CompareNumericFuzzy()]
+ comparisons = [
+ ("--id=p1", "--id=p2", "--presetFormat=TaP_start") + olddefaults,
+ ("--method=presets", "--presetFormat=TaP_start", "--id=p1") + olddefaults,
+ ("--method=presets", "--presetFormat=TaP_end", "--id=p2") + olddefaults,
+ ("--method=presets", "--presetFormat=FT_start", "--id=p1") + olddefaults,
+ ("--method=presets", "--presetFormat=FT_bbox", "--id=p2") + olddefaults,
+ ("--method=presets", "--presetFormat=FT_bbox", "--id=p2") + olddefaults,
+ ("--type=area", "--id=p1", "--presetFormat=TaP_start") + olddefaults,
+ ("--type=cofm", "--id=c3", "--presetFormat=TaP_start") + olddefaults,
+ ]
+
+
+class LengthComplexTransformTest(ComparisonMixin, TestCase):
+ effect_class = MeasureLength
+ compare_filters = [CompareNumericFuzzy()]
+ compare_file = "svg/complextransform.test.svg"
+ comparisons = [
+ ("--method=presets", "--presetFormat=TaP_start", "--id=D") + olddefaults,
+ ("--method=presets", "--presetFormat=FT_start", "--id=D") + olddefaults,
+ ("--type=cofm", "--id=D", "--presetFormat=TaP_start") + olddefaults,
+ ]