def test_truncated_length(): p = longpoll.PushDataParser() assert list(p.get_submissions('13')) == []
def test_malformed_length(): p = longpoll.PushDataParser() # TODO: could detect errors like these with some extra work assert list( p.get_submissions('11\n0123456789\n5e\n"abc"')) == ['0123456789\n']
def test_truncated_message(): p = longpoll.PushDataParser() assert list(p.get_submissions('12\n012345678')) == []