aboutsummaryrefslogblamecommitdiffstats
path: root/tests/test_signald.py
blob: 961f2e87bfb642930cbe1c686aad7a2da2737a1d (plain) (tree)
1
2
3
4
5
6
7
8
9



                                             
 

                  
                  
                         

                                                          




                             
                                               


                            
                                                           

                            
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", order=10)
    def foo(message, match):
        pass

    @s.chat_handler(re.compile("compiled regex"), order=20)
    def bar(message, match):
        pass