-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Craig Ceremuga
authored and
Craig Ceremuga
committed
Nov 10, 2019
1 parent
06db19d
commit 7c0c030
Showing
3 changed files
with
34 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
aprslib | ||
pytest | ||
pytest-cov >= 2.4.0, < 2.6 | ||
coveralls | ||
pytest | ||
pytest-cov >= 2.4.0, < 2.6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
from unittest import mock | ||
|
||
from pypacket.base.aprs_is_processor import AprsIsProcessor | ||
from pypacket.base.configuration import Configuration | ||
from pypacket.util.logger import Logger | ||
|
||
class TestAprsIsProcessor: | ||
@mock.patch('aprslib.IS.connect') | ||
def test_load_expect_connected(self, mock_connect): | ||
test_configuration = Configuration() | ||
test_logger = Logger() | ||
processor = AprsIsProcessor() | ||
|
||
processor.load(test_configuration, test_logger) | ||
|
||
mock_connect.assert_called_once() | ||
|
||
@mock.patch('aprslib.IS.sendall') | ||
def test_handle_expect_handled(self, mock_handle): | ||
test_configuration = Configuration() | ||
test_logger = Logger() | ||
processor = AprsIsProcessor() | ||
processor.is_connected = True | ||
processor.load(test_configuration, test_logger) | ||
|
||
processor.handle(None) | ||
|
||
mock_handle.assert_called_once() | ||
|
||
|