Adopt mise for development workflows
- Lock Python and uv versions with mise - Add unified sync, app, test, lint, format, and typecheck tasks - Update development documentation and strengthen type handling
This commit is contained in:
parent
d04ab6feaf
commit
780d9c12fe
19 changed files with 216 additions and 901 deletions
|
|
@ -6,6 +6,7 @@ DNS name entries, validation, and mutual exclusion logic.
|
|||
"""
|
||||
|
||||
import pytest
|
||||
from typing import cast
|
||||
from unittest.mock import Mock
|
||||
from textual.widgets import Input, Checkbox, RadioSet, Static
|
||||
|
||||
|
|
@ -177,10 +178,7 @@ class TestAddEntryModalDNSSupport:
|
|||
self.modal.query_one = Mock(side_effect=Exception("Widget not found"))
|
||||
|
||||
# This should not raise an exception
|
||||
try:
|
||||
self.modal._show_error("dns-error", "Test error message")
|
||||
except Exception:
|
||||
pytest.fail("_show_error should handle missing widgets gracefully")
|
||||
self.modal._show_error("dns-error", "Test error message")
|
||||
|
||||
|
||||
class TestAddEntryModalRadioButtonLogic:
|
||||
|
|
@ -222,7 +220,7 @@ class TestAddEntryModalRadioButtonLogic:
|
|||
event = MockEvent()
|
||||
|
||||
# Call the event handler
|
||||
self.modal.on_radio_set_changed(event)
|
||||
self.modal.on_radio_set_changed(cast(RadioSet.Changed, event))
|
||||
|
||||
# Verify IP section is shown and DNS section is hidden
|
||||
mock_ip_section.remove_class.assert_called_with("hidden")
|
||||
|
|
@ -261,7 +259,7 @@ class TestAddEntryModalRadioButtonLogic:
|
|||
event = MockEvent()
|
||||
|
||||
# Call the event handler
|
||||
self.modal.on_radio_set_changed(event)
|
||||
self.modal.on_radio_set_changed(cast(RadioSet.Changed, event))
|
||||
|
||||
# Verify DNS section is shown and IP section is hidden
|
||||
mock_ip_section.add_class.assert_called_with("hidden")
|
||||
|
|
@ -324,7 +322,7 @@ class TestAddEntryModalSaveLogic:
|
|||
|
||||
# Verify validation was called
|
||||
self.modal._validate_input.assert_called_once_with(
|
||||
"192.168.1.1", "", "example.com, www.example.com", None
|
||||
"192.168.1.1", "", "example.com, www.example.com", False
|
||||
)
|
||||
|
||||
# Verify modal was dismissed with a HostEntry
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue