diff options
author | Ryan Huber <rhuber@gmail.com> | 2017-04-12 16:47:43 +0000 |
---|---|---|
committer | Ryan Huber <rhuber@gmail.com> | 2017-04-12 16:47:43 +0000 |
commit | 95fa084893660b655388604084f082a080f1ba32 (patch) | |
tree | 8c667c21f591572052f6b3a046c1b94712285c40 /_pytest/test_everything.py | |
parent | 01beb42fec5c6dbfc0d8c53ce1de88b48b48f6db (diff) | |
download | wee-slack-95fa084893660b655388604084f082a080f1ba32.tar.gz |
massssssssive merge of the new codebase
Diffstat (limited to '_pytest/test_everything.py')
-rw-r--r-- | _pytest/test_everything.py | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/_pytest/test_everything.py b/_pytest/test_everything.py new file mode 100644 index 0000000..a121541 --- /dev/null +++ b/_pytest/test_everything.py @@ -0,0 +1,50 @@ +import glob +import json + +#from wee_slack import render +from wee_slack import ProcessNotImplemented + +def test_process_message(monkeypatch, realish_eventrouter, mock_websocket): + + eventrouter = realish_eventrouter + + t = eventrouter.teams.keys()[0] + #u = eventrouter.teams[t].users.keys()[0] + + #user = eventrouter.teams[t].users[u] + #print user + + socket = mock_websocket + eventrouter.teams[t].ws = socket + + datafiles = glob.glob("_pytest/data/websocket/*.json") + + print datafiles + #assert False + + notimplemented = set() + + for fname in datafiles: + try: + print "####################" + data = json.loads(open(fname, 'r').read()) + socket.add(data) + print data + eventrouter.receive_ws_callback(t) + eventrouter.handle_next() + except ProcessNotImplemented as e: + notimplemented.add(str(e)) + #this handles some message data not existing - need to fix + except KeyError: + pass + + if len(notimplemented) > 0: + print "####################" + print sorted(notimplemented) + print "####################" + + print len(eventrouter.queue) + #assert False + + + |