aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLorenz Diener <[email protected]>2018-05-06 02:05:08 +0200
committerLorenz Diener <[email protected]>2018-05-06 02:05:08 +0200
commit9e368f3814bd5cc77c66869e4487695b493ef5c9 (patch)
tree8e97634a4243358af391df5095fd06c269802ee8 /tests
parent3864bbe0859e6c010a3a796467fd48d896734644 (diff)
downloadmastodon.py-9e368f3814bd5cc77c66869e4487695b493ef5c9.tar.gz
Add more streaming tests
Diffstat (limited to 'tests')
-rw-r--r--tests/test_streaming.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/test_streaming.py b/tests/test_streaming.py
index 08d05b3..883b773 100644
--- a/tests/test_streaming.py
+++ b/tests/test_streaming.py
@@ -154,6 +154,15 @@ def test_unknown_event():
154 assert listener.deletes == [] 154 assert listener.deletes == []
155 assert listener.heartbeats == 0 155 assert listener.heartbeats == 0
156 156
157def test_invalid_event():
158 """But not too tolerant"""
159 listener = Listener()
160 with pytest.raises(MastodonMalformedEventError):
161 listener.handle_stream_([
162 'event: whatup',
163 'data: {}',
164 '',
165 ])
157 166
158def test_missing_event_name(): 167def test_missing_event_name():
159 listener = Listener() 168 listener = Listener()
Powered by cgit v1.2.3 (git 2.41.0)