Add --show-tooltips argument.

This commit is contained in:
Sergey Vartanov 2021-09-11 06:45:46 +03:00
parent 972e4798b0
commit 52301801cd
7 changed files with 65 additions and 10 deletions

View file

@ -46,7 +46,28 @@ def test_render() -> None:
with Path("out/map.svg").open() as output_file:
root: Element = ElementTree.parse(output_file).getroot()
# 4 expected elements: `defs`, `rect` (background), `g` (outline),
# `g` (icon).
assert len(root) == 4
assert len(root[3][0]) == 0
assert root.get("width") == "186.0"
assert root.get("height") == "198.0"
def test_render_with_tooltips() -> None:
"""Test `render` command."""
run(
COMMANDS["render_with_tooltips"] + ["--cache", "tests/data"],
b"INFO Writing output SVG to out/map.svg...\n",
)
with Path("out/map.svg").open() as output_file:
root: Element = ElementTree.parse(output_file).getroot()
# 4 expected elements: `defs`, `rect` (background), `g` (outline),
# `g` (icon).
assert len(root) == 4
assert len(root[3][0]) == 1
assert root[3][0][0].text == "natural: tree"
assert root.get("width") == "186.0"
assert root.get("height") == "198.0"