From f8e209f6ff70d3be08b71b05f4cec753a9dac926 Mon Sep 17 00:00:00 2001 From: Lorenz Diener Date: Sun, 6 May 2018 02:26:19 +0200 Subject: Add more tests --- tests/test_streaming.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tests/test_streaming.py') 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(): '', ]) +def test_invalid_json(): + """But not too tolerant""" + listener = Listener() + with pytest.raises(MastodonMalformedEventError): + listener.handle_stream_([ + 'event: blahblah', + 'data: {kjaslkdjalskdjasd asdkjhak ajdasldasd}', + '', + ]) + def test_missing_event_name(): listener = Listener() with pytest.raises(MastodonMalformedEventError): -- cgit v1.2.3