Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.11/site-packages/icalendar/tests/fuzzed/__init__.py: 100%

Shortcuts on this page

r m x   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

10 statements  

1"""This is a collection of test files that are generated from the fuzzer. 

2 

3The fuzzer finds the cases in which the icalendar module breaks. 

4These test cases reproduce the failure. 

5Some more tests can be added to make sure that the behavior works properly. 

6""" 

7 

8 

9def fuzz_calendar_v1( 

10 from_ical, calendar_string: str, multiple: bool, should_walk: bool 

11): 

12 """Take a from_ical function and reproduce the error. 

13 

14 The calendar_string is a fuzzed input. 

15 """ 

16 cal = from_ical(calendar_string, multiple=multiple) 

17 

18 if not multiple: 

19 cal = [cal] 

20 for c in cal: 

21 if should_walk: 

22 for event in c.walk("VEVENT"): 

23 event.to_ical() 

24 else: 

25 c.to_ical()