"""Resolver für leere/fehlende Kategorie je import_type."""

from routers.import_wiki import (
    CATEGORY_EXERCISES,
    CATEGORY_METHODS,
    CATEGORY_SKILLS,
    _wiki_category_or_default,
)


def test_wiki_category_or_default_explicit():
    assert _wiki_category_or_default("  MeineKat  ", "skill") == "MeineKat"


def test_wiki_category_or_default_falls_through():
    assert _wiki_category_or_default(None, "exercise") == CATEGORY_EXERCISES
    assert _wiki_category_or_default("", "skill") == CATEGORY_SKILLS
    assert _wiki_category_or_default("  ", "method") == CATEGORY_METHODS
