diff options
author | Lorenz Diener <[email protected]> | 2018-05-06 02:05:08 +0200 |
---|---|---|
committer | Lorenz Diener <[email protected]> | 2018-05-06 02:05:08 +0200 |
commit | 9e368f3814bd5cc77c66869e4487695b493ef5c9 (patch) | |
tree | 8e97634a4243358af391df5095fd06c269802ee8 /tests | |
parent | 3864bbe0859e6c010a3a796467fd48d896734644 (diff) | |
download | mastodon.py-9e368f3814bd5cc77c66869e4487695b493ef5c9.tar.gz |
Add more streaming tests
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_streaming.py | 9 |
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 | ||
157 | def 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 | ||
158 | def test_missing_event_name(): | 167 | def test_missing_event_name(): |
159 | listener = Listener() | 168 | listener = Listener() |