aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLorenz Diener <[email protected]>2018-05-06 02:26:19 +0200
committerLorenz Diener <[email protected]>2018-05-06 02:26:19 +0200
commitf8e209f6ff70d3be08b71b05f4cec753a9dac926 (patch)
tree01d8c51afadb49350b2fde718f2a5cb1351b2d2f /tests/test_streaming.py
parentf34a1803a398a94f1231345145140291cd699398 (diff)
downloadmastodon.py-f8e209f6ff70d3be08b71b05f4cec753a9dac926.tar.gz
Add more tests
Diffstat (limited to 'tests/test_streaming.py')
-rw-r--r--tests/test_streaming.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/test_streaming.py b/tests/test_streaming.py
index 883b773..33d1381 100644
--- a/tests/test_streaming.py
+++ b/tests/test_streaming.py
@@ -164,6 +164,16 @@ def test_invalid_event():
164 '', 164 '',
165 ]) 165 ])
166 166
167def test_invalid_json():
168 """But not too tolerant"""
169 listener = Listener()
170 with pytest.raises(MastodonMalformedEventError):
171 listener.handle_stream_([
172 'event: blahblah',
173 'data: {kjaslkdjalskdjasd asdkjhak ajdasldasd}',
174 '',
175 ])
176
167def test_missing_event_name(): 177def test_missing_event_name():
168 listener = Listener() 178 listener = Listener()
169 with pytest.raises(MastodonMalformedEventError): 179 with pytest.raises(MastodonMalformedEventError):
Powered by cgit v1.2.3 (git 2.41.0)