aboutsummaryrefslogtreecommitdiffstats
path: root/_pytest/test_processteamjoin.py
blob: 8e83458a261fc86f5fe9149f6458a27d8b8e8ee2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
from __future__ import print_function, unicode_literals

import json


def test_process_team_join(realish_eventrouter, team):
    # delete charles so we can add him
    del team.users['U4096CBHC']

    assert len(team.users) == 3

    datafile = '_pytest/data/websocket/1485975606.59-team_join.json'
    data = json.loads(open(datafile, 'r').read())
    team.ws.add(data)
    realish_eventrouter.receive_ws_callback(team.team_hash)
    realish_eventrouter.handle_next()

    assert len(team.users) == 4