diff --git a/src/icalendar/tests/calendars/pr_480_summary_with_colon.ics b/src/icalendar/tests/calendars/pr_480_summary_with_colon.ics index 3494aec..96b6917 100644 --- a/src/icalendar/tests/calendars/pr_480_summary_with_colon.ics +++ b/src/icalendar/tests/calendars/pr_480_summary_with_colon.ics @@ -5,4 +5,3 @@ END:VEVENT BEGIN:VEVENT SUMMARY:Another event with a ': ' in the summary END:VEVENT -END:VCALENDAR diff --git a/src/icalendar/tests/timezoned.ics b/src/icalendar/tests/calendars/timezoned.ics similarity index 100% rename from src/icalendar/tests/timezoned.ics rename to src/icalendar/tests/calendars/timezoned.ics diff --git a/src/icalendar/tests/conftest.py b/src/icalendar/tests/conftest.py index c823a01..4a954a2 100644 --- a/src/icalendar/tests/conftest.py +++ b/src/icalendar/tests/conftest.py @@ -23,6 +23,8 @@ class DataSource: """Parse a file and return the result stored in the attribute.""" source_file = attribute.replace('-', '_') + '.ics' source_path = os.path.join(self._data_source_folder, source_file) + if not os.path.isfile(source_path): + raise AttributeError(f"{source_path} does not exist.") with open(source_path, 'rb') as f: raw_ics = f.read() source = self._parser(raw_ics) @@ -84,9 +86,10 @@ def in_timezone(request): (data, key) for data in [CALENDARS, TIMEZONES, EVENTS] for key in data.keys() if key not in - ( + ( # exclude broken calendars here "big_bad_calendar", "issue_104_broken_calendar", "small_bad_calendar", - "multiple_calendar_components") + "multiple_calendar_components", "pr_480_summary_with_colon" + ) ]) def ics_file(request): """An example ICS file.""" diff --git a/src/icalendar/tests/test_timezoned.py b/src/icalendar/tests/test_timezoned.py index 2f284f8..ee3ec11 100644 --- a/src/icalendar/tests/test_timezoned.py +++ b/src/icalendar/tests/test_timezoned.py @@ -14,7 +14,7 @@ class TestTimezoned(unittest.TestCase): def test_create_from_ical_zoneinfo(self): directory = os.path.dirname(__file__) - with open(os.path.join(directory, 'timezoned.ics'), 'rb') as fp: + with open(os.path.join(directory, 'calendars', 'timezoned.ics'), 'rb') as fp: data = fp.read() cal = icalendar.Calendar.from_ical(data) @@ -47,7 +47,7 @@ class TestTimezoned(unittest.TestCase): def test_create_from_ical_pytz(self): directory = os.path.dirname(__file__) - with open(os.path.join(directory, 'timezoned.ics'), 'rb') as fp: + with open(os.path.join(directory, 'calendars', 'timezoned.ics'), 'rb') as fp: data = fp.read() cal = icalendar.Calendar.from_ical(data)