mirror of
https://github.com/enzet/map-machine.git
synced 2025-05-24 22:46:22 +02:00
Add test for MapCSS generation.
This commit is contained in:
parent
6126c6cfd5
commit
ec389be1ae
1 changed files with 27 additions and 0 deletions
27
test/test_mapcss.py
Normal file
27
test/test_mapcss.py
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
"""
|
||||||
|
Test MapCSS generation.
|
||||||
|
"""
|
||||||
|
from roentgen.mapcss import MapCSSWriter
|
||||||
|
from roentgen.scheme import NodeMatcher
|
||||||
|
from test import SCHEME
|
||||||
|
|
||||||
|
__author__ = "Sergey Vartanov"
|
||||||
|
__email__ = "me@enzet.ru"
|
||||||
|
|
||||||
|
|
||||||
|
def test_mapcss() -> None:
|
||||||
|
"""
|
||||||
|
Test MapCSS generation.
|
||||||
|
"""
|
||||||
|
writer: MapCSSWriter = MapCSSWriter(SCHEME, "icons", False)
|
||||||
|
matcher: NodeMatcher = NodeMatcher(
|
||||||
|
{"tags": {"natural": "tree"}, "shapes": ["tree"]}
|
||||||
|
)
|
||||||
|
selector = writer.add_selector("node", matcher)
|
||||||
|
assert (
|
||||||
|
selector
|
||||||
|
== """node[natural="tree"] {
|
||||||
|
icon-image: "icons/tree.svg";
|
||||||
|
}
|
||||||
|
"""
|
||||||
|
)
|
Loading…
Add table
Add a link
Reference in a new issue