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

                                                               
                                  
                                      

                             
                 
                                  
                                      

                           
                                                                 
 

                                          
 

                                        
from __future__ import print_function, unicode_literals


def test_PresenceChange(realish_eventrouter, team, user_alice):
    team.ws.add({
        "type": "presence_change",
        "user": user_alice.identifier,
        "presence": "active",
    })
    team.ws.add({
        "type": "presence_change",
        "user": user_alice.identifier,
        "presence": "away",
    })
    realish_eventrouter.receive_ws_callback(team.team_hash, None)

    realish_eventrouter.handle_next()
    assert user_alice.presence == "active"

    realish_eventrouter.handle_next()
    assert user_alice.presence == "away"