refactor(tests): Add strict type hints to third batch of test files
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
import pytest
|
||||
from unittest.mock import patch, MagicMock
|
||||
from typing import Any
|
||||
from gui_2 import App
|
||||
|
||||
@pytest.fixture
|
||||
def app_instance():
|
||||
def app_instance() -> Any:
|
||||
# We patch the dependencies of App.__init__ to avoid side effects
|
||||
with (
|
||||
patch('gui_2.load_config', return_value={'ai': {}, 'projects': {}}),
|
||||
@@ -23,7 +24,7 @@ def app_instance():
|
||||
# Return the app and the mock_pm for use in tests
|
||||
yield app, mock_pm
|
||||
|
||||
def test_mma_dashboard_refresh(app_instance):
|
||||
def test_mma_dashboard_refresh(app_instance: Any) -> None:
|
||||
app, mock_pm = app_instance
|
||||
# 1. Define mock tracks
|
||||
mock_tracks = [
|
||||
@@ -43,7 +44,7 @@ def test_mma_dashboard_refresh(app_instance):
|
||||
# Verify get_all_tracks was called with the correct base_dir
|
||||
mock_pm.get_all_tracks.assert_called_with(app.ui_files_base_dir)
|
||||
|
||||
def test_mma_dashboard_initialization_refresh(app_instance):
|
||||
def test_mma_dashboard_initialization_refresh(app_instance: Any) -> None:
|
||||
"""
|
||||
Checks that _refresh_from_project is called during initialization if
|
||||
_load_active_project is NOT mocked to skip it (but here it IS mocked in fixture).
|
||||
|
||||
Reference in New Issue
Block a user