2933b8c1ea
Co-authored-by: Copilot <copilot@github.com>
26 lines
727 B
Python
26 lines
727 B
Python
"""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
|