Enhance status messages and layout in HostsManagerApp; improve error handling and testing for status updates
This commit is contained in:
parent
02423fe4f2
commit
d477328bea
3 changed files with 56 additions and 20 deletions
|
@ -243,14 +243,17 @@ class TestHostsManagerApp:
|
|||
|
||||
app = HostsManagerApp()
|
||||
|
||||
# Mock the query_one method
|
||||
# Mock the query_one method and set_timer to avoid event loop issues
|
||||
mock_status = Mock()
|
||||
app.query_one = Mock(return_value=mock_status)
|
||||
app.set_timer = Mock() # Mock the timer to avoid event loop issues
|
||||
|
||||
app.update_status("Custom status message")
|
||||
|
||||
# Verify status was updated with custom message
|
||||
mock_status.update.assert_called_once_with("Custom status message")
|
||||
# Verify timer was set for auto-clearing
|
||||
app.set_timer.assert_called_once()
|
||||
|
||||
def test_action_reload(self):
|
||||
"""Test reload action."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue