Skip to content

Commit

Permalink
Merge pull request #480 from collective/adjust_assertion_in_max_error…
Browse files Browse the repository at this point in the history
…_length

Adjust assertion of max_error_length test
  • Loading branch information
niccokunzmann committed Oct 31, 2022
2 parents f170dc8 + aea0c52 commit 4b9df78
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/icalendar/tests/calendars/pr_480_summary_with_colon.ics
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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

0 comments on commit 4b9df78

Please sign in to comment.