Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust assertion of max_error_length test #480

Merged
merged 2 commits into from Oct 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/icalendar/tests/calendars/pr_480_summary_with_colon.ics
@@ -0,0 +1,7 @@
BEGIN:VCALENDAR
BEGIN:VEVENT
SUMMARY:Example calendar with a ': ' in the summary
END:VEVENT
BEGIN:VEVENT
SUMMARY:Another event with a ': ' in the summary
END:VEVENT
4 changes: 3 additions & 1 deletion src/icalendar/tests/test_components_break_on_bad_ics.py
Expand Up @@ -31,9 +31,11 @@ def test_rdate_dosent_become_none_on_invalid_input_issue_464(events):
'big_bad_calendar',
'small_bad_calendar',
'multiple_calendar_components',
'pr_480_summary_with_colon',
])
def test_error_message_doesnt_get_too_big(calendars, calendar_name):
with pytest.raises(ValueError) as exception:
calendars[calendar_name]
assert len(str(exception).split(': ')[1]) <= 100
# Ignore part before first : for the test.
assert len(str(exception).split(': ', 1)[1]) <= 100