diff --git a/test/test_icons.py b/test/test_icons.py index 53fd381..142f095 100644 --- a/test/test_icons.py +++ b/test/test_icons.py @@ -11,6 +11,11 @@ from roentgen.grid import draw_all_icons from roentgen.icon import ShapeExtractor from roentgen.scheme import Scheme +SCHEME: Scheme = Scheme("scheme/default.yml") +ICON_EXTRACTOR: ShapeExtractor = ShapeExtractor( + "icons/icons.svg", Path("icons/config.json") +) + def test_icons() -> None: """ Test grid drawing. """ @@ -19,11 +24,7 @@ def test_icons() -> None: def get_icon(tags: Dict[str, str]): - scheme = Scheme("scheme/default.yml") - icon_extractor = ShapeExtractor( - "icons/icons.svg", Path("icons/config.json") - ) - icon, _ = scheme.get_icon(icon_extractor, tags) + icon, _ = SCHEME.get_icon(ICON_EXTRACTOR, tags) return icon diff --git a/test/test_label.py b/test/test_label.py index 0acccc7..ff27064 100644 --- a/test/test_label.py +++ b/test/test_label.py @@ -8,13 +8,14 @@ from typing import List from roentgen.scheme import Scheme from roentgen.text import Label +SCHEME: Scheme = Scheme("scheme/default.yml") + def construct_labels(tags) -> List[Label]: """ Construct labels from OSM node tags. """ - scheme = Scheme("scheme/default.yml") - return scheme.construct_text(tags, True) + return SCHEME.construct_text(tags, "all") def test_1_label() -> None: