mirror of
https://github.com/hemna/aprsd-slack-plugin.git
synced 2024-11-15 12:52:03 -05:00
19 lines
555 B
Python
19 lines
555 B
Python
import unittest
|
|
from unittest import mock
|
|
|
|
from aprsd_slack_plugin import location_plugin
|
|
|
|
|
|
class TestPlugin(unittest.TestCase):
|
|
@mock.patch.object(location_plugin.SlackLocationPlugin, "filter")
|
|
def test_plugin(self, mock_command):
|
|
mock_command.return_value = ""
|
|
|
|
config = {
|
|
"slack": {"signing_secret": "something", "bot_token": "sometoken", "channel": "hemna"},
|
|
}
|
|
|
|
p = location_plugin.SlackLocationPlugin(config)
|
|
packet = {"from": "WB4BOR", "message_text": "location"}
|
|
p.filter(packet)
|