aboutsummaryrefslogtreecommitdiffstats
path: root/_pytest/test_processteamjoin.py
diff options
context:
space:
mode:
authorTrygve Aaberge <trygveaa@gmail.com>2018-06-11 21:19:03 +0200
committerGitHub <noreply@github.com>2018-06-11 21:19:03 +0200
commiteea510fb7839a0269fc637a9d91bb935bef60486 (patch)
tree20f093bf644a1604edeac26e89f3ca3faf24876c /_pytest/test_processteamjoin.py
parentdc15658f300f6ce2ff57ab3f493f6d72ee097db9 (diff)
downloadwee-slack-eea510fb7839a0269fc637a9d91bb935bef60486.tar.gz
Don't raise exception on missing event callbacks (#589)
These missing callbacks are not really errors or exceptions, and we don't need to implement all of them. Raising an exception makes the users think something isn't working, and is confusing.
Diffstat (limited to '_pytest/test_processteamjoin.py')
-rw-r--r--_pytest/test_processteamjoin.py38
1 files changed, 5 insertions, 33 deletions
diff --git a/_pytest/test_processteamjoin.py b/_pytest/test_processteamjoin.py
index c7c199f..1d2be09 100644
--- a/_pytest/test_processteamjoin.py
+++ b/_pytest/test_processteamjoin.py
@@ -1,17 +1,11 @@
import glob
import json
-from wee_slack import ProcessNotImplemented
-
def test_process_team_join(mock_websocket, realish_eventrouter):
eventrouter = realish_eventrouter
t = eventrouter.teams.keys()[0]
- #u = eventrouter.teams[t].users.keys()[0]
-
- #user = eventrouter.teams[t].users[u]
- #print user
#delete charles so we can add him
del eventrouter.teams[t].users['U4096CBHC']
@@ -23,32 +17,10 @@ def test_process_team_join(mock_websocket, realish_eventrouter):
datafiles = glob.glob("_pytest/data/websocket/1485975606.59-team_join.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 len(eventrouter.teams[t].users) == 4
-
-
+ data = json.loads(open(fname, 'r').read())
+ socket.add(data)
+ eventrouter.receive_ws_callback(t)
+ eventrouter.handle_next()
+ assert len(eventrouter.teams[t].users) == 4