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
|
|
|
|
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 = ""
|
|
|
|
|
|
|
|
config = {
|
2021-01-12 15:59:13 -05:00
|
|
|
"slack": {"signing_secret": "something", "bot_token": "sometoken", "channel": "hemna"},
|
2020-12-14 09:50:39 -05:00
|
|
|
}
|
|
|
|
|
2021-06-17 13:32:55 -04:00
|
|
|
p = location_plugin.SlackLocationPlugin(config)
|
2022-12-18 13:03:25 -05:00
|
|
|
packet = {"from": "WB4BOR", "message_text": "location"}
|
|
|
|
p.filter(packet)
|