File: test_dpiswitcher.py

package info (click to toggle)
inkscape 1.4.2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 402,900 kB
  • sloc: cpp: 547,256; python: 72,677; ansic: 63,355; javascript: 3,864; xml: 2,345; sh: 1,667; makefile: 824; perl: 614
file content (34 lines) | stat: -rw-r--r-- 1,069 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# 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