summaryrefslogtreecommitdiffstats
path: root/share/extensions/tests/test_pixelsnap.py
blob: 074abe0d11a14bb1e04b45e6bc56eff4ca4e96af (plain)
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
35
36
# coding=utf-8
from pixelsnap import PixelSnap
from inkex.tester import ComparisonMixin, TestCase
from inkex.tester.filters import CompareOrderIndependentStyle


class TestPixelSnapEffectBasic(ComparisonMixin, TestCase):
    effect_class = PixelSnap
    compare_filters = [CompareOrderIndependentStyle()]
    comparisons = [("--id=p1", "--id=r3", "--snap_to=bl")]


class TestPixelSnapEffectMM(ComparisonMixin, TestCase):
    """Test pixel snap in mm based documents"""

    effect_class = PixelSnap
    compare_file = "svg/pixelsnap_simple.svg"
    compare_filters = [CompareOrderIndependentStyle()]
    comparisons = [
        (
            "--id=rect1144",
            "--id=path1302",
            "--id=path1430",
            "--id=path1434",
            "--id=path1434",
            "--snap_to=tl",
        ),
        (
            "--id=rect1144",
            "--id=path1302",
            "--id=path1430",
            "--id=path1434",
            "--id=path1434",
            "--snap_to=bl",
        ),
    ]