From 7db9bf2aa06bdb169a6271069dcace98f57d67d5 Mon Sep 17 00:00:00 2001 From: Nicco Kunzmann Date: Sat, 4 Nov 2023 18:45:30 +0000 Subject: [PATCH] reproduce fuzzing error see https://github.com/collective/icalendar/pull/577#discussion_r1382441779 --- src/icalendar/tests/test_oss_fuzz_errors.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 src/icalendar/tests/test_oss_fuzz_errors.py diff --git a/src/icalendar/tests/test_oss_fuzz_errors.py b/src/icalendar/tests/test_oss_fuzz_errors.py new file mode 100644 index 00000000..fdf380e6 --- /dev/null +++ b/src/icalendar/tests/test_oss_fuzz_errors.py @@ -0,0 +1,9 @@ +"""This file collects errors that the OSS FUZZ build has found.""" +from icalendar import Calendar +import pytest + + +def test_stack_is_empty(): + """If we get passed an invalid string, we expect to get a ValueError.""" + with pytest.raises(ValueError): + Calendar.from_ical("END:CALENDAR")