Add way style test.

This commit is contained in:
Sergey Vartanov 2021-05-25 02:47:17 +03:00
parent 6aef415579
commit f1702ece36

View file

@ -28,3 +28,26 @@ def test_style_area() -> None:
style = SCHEME.get_style({"landuse": "grass"}, 18) style = SCHEME.get_style({"landuse": "grass"}, 18)
assert len(style) == 1 assert len(style) == 1
assert style[0].style == {"fill": "#CFE0A8", "stroke": "#BFD098"} assert style[0].style == {"fill": "#CFE0A8", "stroke": "#BFD098"}
def test_style_way() -> None:
"""
Test constructing style of highway=primary.
"""
style = SCHEME.get_style({"highway": "primary"}, 18)
assert len(style) == 2
assert style[0].style == {
"fill": "none",
"stroke": "#AA8800",
"stroke-linecap": "round",
"stroke-linejoin": "round",
"stroke-width": 200,
}
assert style[1].style == {
"fill": "none",
"stroke": "#FFDD66",
"stroke-linecap": "round",
"stroke-linejoin": "round",
"stroke-width": 198,
}
assert style[0].priority < style[1].priority