aboutsummaryrefslogtreecommitdiffstats
path: root/_pytest/test_everything.py
blob: 5ac4b626a0beb2360cb56c655f0d1ccf457a5cc8 (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
from __future__ import print_function, unicode_literals

import glob
import json

def test_everything(realish_eventrouter, mock_websocket):

    eventrouter = realish_eventrouter

    t = eventrouter.teams.keys()[0]

    socket = mock_websocket
    eventrouter.teams[t].ws = socket

    datafiles = glob.glob("_pytest/data/websocket/*.json")

    for fname in sorted(datafiles):
        data = json.loads(open(fname, 'r').read())
        socket.add(data)
        eventrouter.receive_ws_callback(t)
        eventrouter.handle_next()

    assert len(eventrouter.queue) == 14