From a1fa6b4db8533e088ae7eee2c8696f789201bd73 Mon Sep 17 00:00:00 2001 From: Sergey Vartanov Date: Wed, 5 May 2021 23:00:18 +0300 Subject: [PATCH] Add more icon tests. --- icons/icons.svg | 71 +++++++++++++++++++++++++++++++++++----------- test/test_icons.py | 18 ++++++++++++ 2 files changed, 73 insertions(+), 16 deletions(-) diff --git a/icons/icons.svg b/icons/icons.svg index a813717..8d49faf 100644 --- a/icons/icons.svg +++ b/icons/icons.svg @@ -171,9 +171,9 @@ showgrid="true" inkscape:document-units="px" inkscape:current-layer="layer1" - inkscape:cy="514.66521" - inkscape:cx="327.2049" - inkscape:zoom="32" + inkscape:cy="401.52812" + inkscape:cx="171.64141" + inkscape:zoom="2.8284271" inkscape:pageshadow="2" inkscape:pageopacity="0.0" borderopacity="1.0" @@ -1336,7 +1336,10 @@ inkscape:connector-curvature="0" id="train" d="m 4,178 c -0.554,0 -1,0.446 -1,1 l 0,1 0,6 0,1 c 0,0.554 0.446,1 1,1 l 1,0 6,0 1,0 c 0.554,0 1,-0.446 1,-1 l 0,-1 0,-6 0,-1 c 0,-0.554 -0.446,-1 -1,-1 l -1,0 -6,0 -1,0 z m 0.5,2 0.5,0 0.5,0 5,0 0.5,0 0.5,0 c 0.277,0 0.5,0.223 0.5,0.5 l 0,0.5 0,0.5 0,1 0,0.5 0,0.5 c 0,0.277 -0.223,0.5 -0.5,0.5 l -0.5,0 -0.5,0 -5,0 -0.5,0 -0.5,0 C 4.223,184 4,183.777 4,183.5 l 0,-0.5 0,-0.5 0,-1 0,-0.5 0,-0.5 C 4,180.223 4.223,180 4.5,180 Z m 0,5 1,0 c 0.277,0 0.5,0.223 0.5,0.5 l 0,1 C 6,186.777 5.777,187 5.5,187 L 5,187 4.5,187 C 4.223,187 4,186.777 4,186.5 L 4,186 4,185.5 C 4,185.223 4.223,185 4.5,185 Z m 6,0 1,0 c 0.277,0 0.5,0.223 0.5,0.5 l 0,0.5 0,0.5 c 0,0.277 -0.223,0.5 -0.5,0.5 l -0.5,0 -0.5,0 c -0.277,0 -0.5,-0.223 -0.5,-0.5 l 0,-0.5 0,-0.5 c 0,-0.20775 0.13292,-0.39305 0.3125,-0.46875 0.0599,-0.0252 0.11825,-0.0312 0.1875,-0.0312 z m -6.5,4 0,1 -1.5,0 c -0.277,0 -0.5,0.223 -0.5,0.5 0,0.277 0.223,0.5 0.5,0.5 l 11,0 c 0.277,0 0.5,-0.223 0.5,-0.5 0,-0.277 -0.223,-0.5 -0.5,-0.5 l -1.5,0 0,-1 -1,0 0,1 -6,0 0,-1 -1,0 z" - style="fill:#000000;fill-opacity:1;stroke:none" /> + style="fill:#000000;fill-opacity:1;stroke:none"> + train + + style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1px;marker:none;enable-background:accumulate"> + statue + + style="fill:#000000;fill-opacity:1;stroke:none"> + plaque with inscription + + style="fill:#000000;fill-opacity:1;stroke:none"> + turnstile + + style="fill:#000000;stroke:none"> + bus + + style="fill:#000000;stroke:none"> + trolleybus + + inkscape:connector-curvature="0"> + tram + + style="fill:#000000;stroke:none"> + door + + style="fill:#000000;stroke:none"> + door with stairs + + style="opacity:1;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"> + onion roof shape + + style="fill:#000000;stroke:#000000;stroke-width:0.1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"> + fishing angle + + style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:#000000;stroke:none;stroke-width:0.1;stroke-miterlimit:4;stroke-dasharray:none;marker:none;enable-background:accumulate"> + picture frame + + inkscape:connector-curvature="0"> + billboard + None: icon = get_icon({"natural": "tree"}) assert not icon.main_icon[0].is_default() assert not icon.extra_icons + + +def test_icon_1_extra() -> None: + """ + Tags that should be visualized with single main icon and single extra icon. + """ + icon = get_icon({"barrier": "gate", "access": "private"}) + assert not icon.main_icon[0].is_default() + assert len(icon.extra_icons) == 1 + + +def test_icon_2_extra() -> None: + """ + Tags that should be visualized with single main icon and two extra icons. + """ + icon = get_icon({"barrier": "gate", "access": "private", "bicycle": "yes"}) + assert not icon.main_icon[0].is_default() + assert len(icon.extra_icons) == 2