Skip to content

Commit

Permalink
Added test to ensure type error remains resolved as discovered by OSS…
Browse files Browse the repository at this point in the history
…Fuzz
  • Loading branch information
capuanob committed Nov 5, 2023
1 parent c760122 commit 099b0de
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/icalendar/tests/test_oss_fuzz_errors.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
"""This file collects errors that the OSS FUZZ build has found."""
from datetime import time
from icalendar import Calendar
from icalendar.prop import vDDDLists

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")


def test_vdd_list_type_mismatch():
"""If we pass in a string type, we expect it to be converted to bytes"""
vddd_list = vDDDLists([time(hour=6, minute=6, second=6)])
assert vddd_list.to_ical() == b'060606'

0 comments on commit 099b0de

Please sign in to comment.