aboutsummaryrefslogblamecommitdiffstats
path: root/_pytest/test_processreply.py
blob: 34c26231d401a5798ba1bf4ec63a98efb43fcda7 (plain) (tree)
1
2
3
4
5
6
7
8
9
                                                       
 
                             
 
 
                                                                   

                                           
                                              


                                                                                   
                                                                 
                                     
 

                                                                    

                                               
from __future__ import print_function, unicode_literals

from wee_slack import SlackTS


def test_process_reply(realish_eventrouter, team, channel_general):
    message_ts = SlackTS("12341234.123456")
    message_text = "reply test"
    channel_general.send_message(message_text)
    team.ws.add(
        {"ok": True, "reply_to": 1, "_team": team.team_hash, "ts": str(message_ts)}
    )
    realish_eventrouter.receive_ws_callback(team.team_hash, None)
    realish_eventrouter.handle_next()

    assert message_ts in channel_general.messages
    message_json = channel_general.messages[message_ts].message_json
    assert message_json["ts"] == message_ts
    assert message_json["text"] == message_text