2020-12-14 09:50:39 -05:00
|
|
|
import unittest
|
2022-12-18 13:12:49 -05:00
|
|
|
from unittest import mock
|
2020-12-14 09:50:39 -05:00
|
|
|
|
2023-01-10 14:10:46 -05:00
|
|
|
from aprsd import conf # noqa
|
|
|
|
|
|
|
|
from aprsd_slack_plugin import conf as plugin_conf # noqa
|
2021-06-17 13:32:55 -04:00
|
|
|
from aprsd_slack_plugin import location_plugin
|
2020-12-14 09:50:39 -05:00
|
|
|
|
2022-12-18 13:03:25 -05:00
|
|
|
|
2020-12-14 09:50:39 -05:00
|
|
|
class TestPlugin(unittest.TestCase):
|
2022-12-18 13:03:25 -05:00
|
|
|
@mock.patch.object(location_plugin.SlackLocationPlugin, "filter")
|
2020-12-14 09:50:39 -05:00
|
|
|
def test_plugin(self, mock_command):
|
|
|
|
mock_command.return_value = ""
|
|
|
|
|
2023-01-10 14:10:46 -05:00
|
|
|
p = location_plugin.SlackLocationPlugin()
|
2022-12-18 13:03:25 -05:00
|
|
|
packet = {"from": "WB4BOR", "message_text": "location"}
|
|
|
|
p.filter(packet)
|