mirror of
https://github.com/craigerl/aprsd.git
synced 2026-08-28 14:55:37 -04:00
fix: APRSISDriver.is_configured() returns False when driver is disabled (#236)
The final `return True` in is_configured() should be `return False`. When APRS-IS is not enabled, the method always returned True, so the startup guard in server.py never fired for misconfigured instances. Closes #2
This commit is contained in:
@@ -8,6 +8,8 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
||||
|
||||
##### Bug Fixes
|
||||
|
||||
- Fix APRSISDriver.is_configured() always returning True when driver is disabled [`a9ef65f`](https://github.com/craigerl/aprsd/commit/a9ef65f)
|
||||
|
||||
- Fix PacketList.tx() docstring: "received" → "transmitted" [`2e3d556`](https://github.com/craigerl/aprsd/commit/2e3d556)
|
||||
|
||||
- Add aprsd/~/ to .gitignore; remove stale tilde directory from repo [`1b08e1c`](https://github.com/craigerl/aprsd/commit/1b08e1c)
|
||||
|
||||
@@ -73,7 +73,7 @@ class APRSISDriver:
|
||||
)
|
||||
|
||||
return True
|
||||
return True
|
||||
return False
|
||||
|
||||
@property
|
||||
def is_alive(self):
|
||||
|
||||
@@ -162,9 +162,9 @@ class TestAPRSISDriver(unittest.TestCase):
|
||||
APRSISDriver.is_configured()
|
||||
|
||||
def test_is_configured_disabled(self):
|
||||
"""Test is_configured returns True when not enabled."""
|
||||
"""Test is_configured returns False when not enabled."""
|
||||
with mock.patch.object(APRSISDriver, 'is_enabled', return_value=False):
|
||||
self.assertTrue(APRSISDriver.is_configured())
|
||||
self.assertFalse(APRSISDriver.is_configured())
|
||||
|
||||
def test_is_alive_no_client(self):
|
||||
"""Test is_alive returns False when no client."""
|
||||
|
||||
Reference in New Issue
Block a user