diff options
author | Lorenz Diener <[email protected]> | 2018-05-06 02:26:19 +0200 |
---|---|---|
committer | Lorenz Diener <[email protected]> | 2018-05-06 02:26:19 +0200 |
commit | f8e209f6ff70d3be08b71b05f4cec753a9dac926 (patch) | |
tree | 01d8c51afadb49350b2fde718f2a5cb1351b2d2f /tests/test_streaming.py | |
parent | f34a1803a398a94f1231345145140291cd699398 (diff) | |
download | mastodon.py-f8e209f6ff70d3be08b71b05f4cec753a9dac926.tar.gz |
Add more tests
Diffstat (limited to 'tests/test_streaming.py')
-rw-r--r-- | tests/test_streaming.py | 10 |
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 | ||
167 | def 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 | |||
167 | def test_missing_event_name(): | 177 | def test_missing_event_name(): |
168 | listener = Listener() | 178 | listener = Listener() |
169 | with pytest.raises(MastodonMalformedEventError): | 179 | with pytest.raises(MastodonMalformedEventError): |