aboutsummaryrefslogtreecommitdiffstats
path: root/_pytest/test_processteamjoin.py
blob: f965bbb09ea48e040e4a15b7173749c12cb984f8 (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, None)
    realish_eventrouter.handle_next()

    assert len(team.users) == 4