summaryrefslogtreecommitdiffstats
path: root/share/extensions/tests/test_dpiswitcher.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_dpiswitcher.py
parentInitial commit. (diff)
downloadinkscape-cca66b9ec4e494c1d919bff0f71a820d8afab1fa.tar.xz
inkscape-cca66b9ec4e494c1d919bff0f71a820d8afab1fa.zip
Adding upstream version 1.2.2.upstream/1.2.2upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--share/extensions/tests/test_dpiswitcher.py33
1 files changed, 33 insertions, 0 deletions
diff --git a/share/extensions/tests/test_dpiswitcher.py b/share/extensions/tests/test_dpiswitcher.py
new file mode 100644
index 0000000..923bcfd
--- /dev/null
+++ b/share/extensions/tests/test_dpiswitcher.py
@@ -0,0 +1,33 @@
+# coding=utf-8
+"""
+Tests for DPISwitcher extensions
+
+python3 -m pytest tests/test_dpiswitcher.py
+
+Generate references:
+python3 dpiswitcher.py tests/data/svg/shapes.svg > tests/data/refs/dpiswitcher.out
+python3 dpiswitcher.py --switcher=0 tests/data/svg/dpiswitcher_96dpi.svg >
+ tests/data/refs/dpiswitcher__--switcher__0.out
+python3 dpiswitcher.py --switcher=1 tests/data/svg/dpiswitcher_96dpi.svg >
+ tests/data/refs/dpiswitcher__--switcher__1.out
+
+"""
+from dpiswitcher import DPISwitcher
+from inkex.tester import ComparisonMixin, TestCase
+from inkex.tester.filters import CompareNumericFuzzy
+
+
+class TestDPISwitcherBasic(ComparisonMixin, TestCase):
+ """Default Test with shapes.svg"""
+
+ effect_class = DPISwitcher
+ compare_filters = [CompareNumericFuzzy()]
+
+
+class TestDPIto90to96(ComparisonMixin, TestCase):
+ """Test file with transformed objects in root"""
+
+ compare_file = "svg/dpiswitcher_96dpi.svg"
+ comparisons = [("--switcher=0",), ("--switcher=1",)]
+ compare_filters = [CompareNumericFuzzy()]
+ effect_class = DPISwitcher