Files
ahriman/tests/ahriman/core/test_module_loader.py
Evgenii Alekseev 93ce7f9a51 feat: use split packages (#135)
* move argument parsers to handlers themselves

* use hatchling instead of flit

* Revert "use hatchling instead of flit"

This reverts commit d18d146d79.

* add package-splitt script

* replace simplify walk method

* split packages

* explicitly install packages

* separate support triggers from main package

* add docs examples

* sort actions

* docs update

* add metapackage

* review fixes
2024-11-01 16:07:04 +02:00

26 lines
686 B
Python

import ahriman.web.views
from pathlib import Path
from ahriman.core.module_loader import _modules, implementations
from ahriman.web.views.base import BaseView
def test_modules() -> None:
"""
must load modules
"""
modules = list(_modules(Path(__file__).parent.parent, "ahriman.web.views"))
assert modules
assert all(not module.ispkg for module in modules)
def test_implementations() -> None:
"""
must load implementations from the package
"""
routes = list(implementations(ahriman.web.views, BaseView))
assert routes
assert all(isinstance(view, type) for view in routes)
assert all(issubclass(view, BaseView) for view in routes)