aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_signald.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_signald.py')
-rw-r--r--tests/test_signald.py21
1 files changed, 18 insertions, 3 deletions
diff --git a/tests/test_signald.py b/tests/test_signald.py
index 801192b..33be9a4 100644
--- a/tests/test_signald.py
+++ b/tests/test_signald.py
@@ -1,8 +1,23 @@
-def test_signal():
- from signald import Signal
- from signald.types import Message, Attachment
+import re
+
+from signald import Signal
+from signald.types import Attachment, Message
+
+def test_signal():
# Smoke tests.
Signal("+1234567890")
Message("+1234567890", "+1234567891", "Hello!")
Attachment("application/json", "123", 123, "/var/123")
+
+
+def test_bot():
+ s = Signal("+1234567890")
+
+ @s.chat_handler("simple message")
+ def foo(message, match):
+ pass
+
+ @s.chat_handler(re.compile("compiled regex"))
+ def bar(message, match):
+ pass