mirror of
https://github.com/craigerl/aprsd.git
synced 2025-10-17 06:00:25 -04:00
Fixed some unit tests
Fixed unit tests related to the updated static method signatures of the client and drivers.
This commit is contained in:
parent
328c027ad3
commit
af0feaf9c8
@ -80,7 +80,7 @@ class TCPKISSDriver:
|
||||
return client.TRANSPORT_TCPKISS
|
||||
|
||||
@staticmethod
|
||||
def is_enabled(cls) -> bool:
|
||||
def is_enabled() -> bool:
|
||||
"""Check if KISS is enabled in configuration.
|
||||
|
||||
Returns:
|
||||
|
@ -353,6 +353,7 @@ class TestAPRSISDriver(unittest.TestCase):
|
||||
def test_consumer_success(self, mock_log):
|
||||
"""Test consumer forwards callback to client."""
|
||||
self.driver._client = self.mock_client
|
||||
self.driver.connected = True
|
||||
mock_callback = mock.MagicMock()
|
||||
|
||||
self.driver.consumer(mock_callback, raw=True)
|
||||
@ -365,6 +366,7 @@ class TestAPRSISDriver(unittest.TestCase):
|
||||
def test_consumer_exception(self, mock_log):
|
||||
"""Test consumer handles exceptions."""
|
||||
self.driver._client = self.mock_client
|
||||
self.driver.connected = True
|
||||
mock_callback = mock.MagicMock()
|
||||
test_error = Exception('Test error')
|
||||
self.mock_client.consumer.side_effect = test_error
|
||||
@ -381,8 +383,6 @@ class TestAPRSISDriver(unittest.TestCase):
|
||||
mock_callback = mock.MagicMock()
|
||||
|
||||
self.driver.consumer(mock_callback)
|
||||
|
||||
mock_log.warning.assert_called_once()
|
||||
self.assertFalse(self.driver.connected)
|
||||
|
||||
def test_stats_configured_with_client(self):
|
||||
|
Loading…
x
Reference in New Issue
Block a user