Add tests for CLI entry point and scoring functionality; enhance service layer tests for similar units

Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
Ole
2026-05-26 13:54:58 +00:00
parent 22f30ebf00
commit 2933b8c1ea
7 changed files with 865 additions and 5 deletions
+25
View File
@@ -0,0 +1,25 @@
"""Tests for the __main__.py entry point."""
from unittest.mock import patch
import pytest
from finn_eiendom.__main__ import app # noqa: F401
def test_main_entry_point():
"""Test that __main__.py can be imported and has the app entry point."""
from finn_eiendom.__main__ import app
assert app is not None
def test_main_via_module():
"""Test that the module can be run with python -m finn_eiendom."""
# This tests that __main__.py correctly invokes the CLI app
with patch("finn_eiendom.cli.app") as mock_app:
# Simulate running via __main__
import finn_eiendom.__main__
# The module should have imported app from cli
assert finn_eiendom.__main__.app is not None