blob: b4202fa8bdde8b1c7e0e2b012ca9df8a7ae0af6f (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
def test_PresenceChange(monkeypatch, realish_eventrouter, mock_websocket):
e = realish_eventrouter
t = e.teams.keys()[0]
u = e.teams[t].users.keys()[0]
user = e.teams[t].users[u]
socket = mock_websocket
e.teams[t].ws = socket
socket.add({
"type": "presence_change",
"user": user.identifier,
"presence": "active",
})
socket.add({
"type": "presence_change",
"user": user.identifier,
"presence": "away",
})
e.receive_ws_callback(t)
e.handle_next()
assert e.teams[t].users[u].presence == "active"
e.receive_ws_callback(t)
e.handle_next()
assert e.teams[t].users[u].presence == "away"
|