mirror of
https://github.com/kuhyx/diet-guard.git
synced 2026-07-04 11:43:07 +02:00
Rewrites python_pkg.diet_guard imports to diet_guard, vendors the shared as_float coercion helper, drops the monorepo PYTHONPATH from install.sh and the systemd unit (package is now pip-installed), and scaffolds standalone lint/test config matching testsAndMisc's real enforced bar (pylint --fail-under=10 with tests excluded and the use-implicit-booleaness/consider-using-with disables, mypy's actual disabled-error-code set, ruff ALL, bandit, 100% branch coverage).
22 lines
663 B
Python
22 lines
663 B
Python
"""Tests for the package entry points (__init__, __main__).
|
|
|
|
Importing ``__main__`` executes its module-level code (the ``if __name__`` guard
|
|
is excluded from coverage), wiring the ``python -m`` entry point under test.
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
import importlib
|
|
|
|
|
|
def test_main_module_imports() -> None:
|
|
"""The ``python -m diet_guard`` entry module imports cleanly."""
|
|
module = importlib.import_module("diet_guard.__main__")
|
|
assert hasattr(module, "main")
|
|
|
|
|
|
def test_package_imports() -> None:
|
|
"""The package itself imports without side effects."""
|
|
package = importlib.import_module("diet_guard")
|
|
assert package is not None
|