From 9e368f3814bd5cc77c66869e4487695b493ef5c9 Mon Sep 17 00:00:00 2001 From: Lorenz Diener Date: Sun, 6 May 2018 02:05:08 +0200 Subject: Add more streaming tests --- tests/test_streaming.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tests') 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(): assert listener.deletes == [] assert listener.heartbeats == 0 +def test_invalid_event(): + """But not too tolerant""" + listener = Listener() + with pytest.raises(MastodonMalformedEventError): + listener.handle_stream_([ + 'event: whatup', + 'data: {}', + '', + ]) def test_missing_event_name(): listener = Listener() -- cgit v1.2.3