diff options
author | Trygve Aaberge <trygveaa@gmail.com> | 2019-03-28 14:12:18 +0100 |
---|---|---|
committer | Trygve Aaberge <trygveaa@gmail.com> | 2019-04-08 15:11:57 +0200 |
commit | 3639342e26f7e890ae600e74c7661ad84abb5700 (patch) | |
tree | 0cee85d1650d3caf87f1dc6ccfe2e11d326eacae /_pytest | |
parent | 4d674dad3f300dc1b5fd48e96d69c6d1a3234beb (diff) | |
download | wee-slack-3639342e26f7e890ae600e74c7661ad84abb5700.tar.gz |
Don't serialize request metadata
It seems pointless to serialize request metadata first with pickle, then
pack it into json, just to unpack both afterwards.
Diffstat (limited to '_pytest')
-rw-r--r-- | _pytest/test_eventrouter.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/_pytest/test_eventrouter.py b/_pytest/test_eventrouter.py index 85a456e..036aa71 100644 --- a/_pytest/test_eventrouter.py +++ b/_pytest/test_eventrouter.py @@ -2,16 +2,16 @@ import pytest from wee_slack import EventRouter, SlackRequest def test_EventRouter(mock_weechat): - # Sending valid json adds to the queue. + # Sending valid object adds to the queue. e = EventRouter() - e.receive_json('{}') + e.receive({}) assert len(e.queue) == 1 # Handling an event removes from the queue. e = EventRouter() # Create a function to test we are called e.proc['testfunc'] = lambda x, y: x - e.receive_json('{"type": "testfunc"}') + e.receive({"type": "testfunc"}) e.handle_next() assert len(e.queue) == 0 @@ -19,7 +19,7 @@ def test_EventRouter(mock_weechat): e = EventRouter() # Create a function to test we are called e.proc['local_testfunc'] = lambda x, y: x - e.receive_json('{"type": "local_testfunc"}') + e.receive({"type": "local_testfunc"}) e.handle_next() assert len(e.queue) == 0 @@ -27,5 +27,5 @@ def test_EventRouter(mock_weechat): # shouldn't raise an exception. e = EventRouter() # Create a function to test we are called - e.receive_json('{"type": "testfunc"}') + e.receive({"type": "testfunc"}) e.handle_next() |