moved timezoned.ics

pull/575/head
Nicco Kunzmann 2023-11-01 00:52:30 +00:00
rodzic 2ae03ec4bf
commit d8d550e096
4 zmienionych plików z 7 dodań i 5 usunięć

Wyświetl plik

@ -5,4 +5,3 @@ END:VEVENT
BEGIN:VEVENT
SUMMARY:Another event with a ': ' in the summary
END:VEVENT
END:VCALENDAR

Wyświetl plik

@ -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."""

Wyświetl plik

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