From b402962bf6c48cf79a7dde51a9e3c3ec2169d22f Mon Sep 17 00:00:00 2001 From: jaca Date: Sat, 29 Oct 2022 17:03:25 +0200 Subject: [PATCH] reflect "DTSTART;VALUE=DATE-TIME:20190616T050000Z" <=> "DTSTART:20190616T050000Z" in tests --- .../created_calendar_with_unicode_fields.ics | 8 ++++---- src/icalendar/tests/test_parsing.py | 4 ++-- src/icalendar/tests/test_timezoned.py | 20 +++++++++---------- src/icalendar/tests/test_unit_cal.py | 10 +++++----- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/icalendar/tests/calendars/created_calendar_with_unicode_fields.ics b/src/icalendar/tests/calendars/created_calendar_with_unicode_fields.ics index f13351c8..b70e8dea 100644 --- a/src/icalendar/tests/calendars/created_calendar_with_unicode_fields.ics +++ b/src/icalendar/tests/calendars/created_calendar_with_unicode_fields.ics @@ -6,16 +6,16 @@ X-WR-CALNAME:äöü ÄÖÜ € X-WR-RELCALID:12345 BEGIN:VEVENT SUMMARY:Non-ASCII Test: ÄÖÜ äöü € -DTSTART;VALUE=DATE-TIME:20101010T100000Z -DTEND;VALUE=DATE-TIME:20101010T120000Z +DTSTART:20101010T100000Z +DTEND:20101010T120000Z UID:123456 -CREATED;VALUE=DATE-TIME:20101010T000000Z +CREATED:20101010T000000Z DESCRIPTION:icalendar should be able to de/serialize non-ascii. LOCATION:Tribstrül END:VEVENT BEGIN:VEVENT SUMMARY:åäö -DTSTART;VALUE=DATE-TIME:20101010T000000Z +DTSTART:20101010T000000Z END:VEVENT BEGIN:VEVENT DESCRIPTION:äöüßÄÖÜ diff --git a/src/icalendar/tests/test_parsing.py b/src/icalendar/tests/test_parsing.py index b01c0914..c46483f5 100644 --- a/src/icalendar/tests/test_parsing.py +++ b/src/icalendar/tests/test_parsing.py @@ -117,8 +117,8 @@ def test_timezones_to_ical_is_inverse_of_from_ical(timezones): assert timezone.to_ical() == timezone.raw_ics @pytest.mark.parametrize('date, expected_output', [ - (datetime(2012, 7, 16, 0, 0, 0), b'DTSTART;VALUE=DATE-TIME:20120716T000000Z'), - (datetime(2021, 11, 17, 15, 9, 15), b'DTSTART;VALUE=DATE-TIME:20211117T150915Z') + (datetime(2012, 7, 16, 0, 0, 0), b'DTSTART:20120716T000000Z'), + (datetime(2021, 11, 17, 15, 9, 15), b'DTSTART:20211117T150915Z') ]) def test_no_tzid_when_utc(utc, date, expected_output): '''Issue #58 - TZID on UTC DATE-TIMEs diff --git a/src/icalendar/tests/test_timezoned.py b/src/icalendar/tests/test_timezoned.py index 7d5d4992..2f284f89 100644 --- a/src/icalendar/tests/test_timezoned.py +++ b/src/icalendar/tests/test_timezoned.py @@ -149,21 +149,21 @@ def test_create_to_ical_pytz(self): test_out = test_out.decode('utf-8') vtimezone_lines = "BEGIN:VTIMEZONE|TZID:Europe/Vienna|X-LIC-LOCATION:" - "Europe/Vienna|BEGIN:STANDARD|DTSTART;VALUE=DATE-TIME:19701025T03" + "Europe/Vienna|BEGIN:STANDARD|DTSTART:19701025T03" "0000|RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10|RRULE:FREQ=YEARLY;B" "YDAY=-1SU;BYMONTH=3|TZNAME:CET|TZOFFSETFROM:+0200|TZOFFSETTO:+01" - "00|END:STANDARD|BEGIN:DAYLIGHT|DTSTART;VALUE=DATE-TIME:19700329T" + "00|END:STANDARD|BEGIN:DAYLIGHT|DTSTART:19700329T" "020000|TZNAME:CEST|TZOFFSETFROM:+0100|TZOFFSETTO:+0200|END:DAYLI" "GHT|END:VTIMEZONE" self.assertTrue(vtimezone_lines in test_out) - test_str = "DTSTART;TZID=Europe/Vienna;VALUE=DATE-TIME:20120213T100000" + test_str = "DTSTART;TZID=Europe/Vienna:20120213T100000" self.assertTrue(test_str in test_out) self.assertTrue("ATTENDEE:sepp" in test_out) # ical standard expects DTSTAMP and CREATED in UTC - self.assertTrue("DTSTAMP;VALUE=DATE-TIME:20101010T081010Z" in test_out) - self.assertTrue("CREATED;VALUE=DATE-TIME:20101010T081010Z" in test_out) + self.assertTrue("DTSTAMP:20101010T081010Z" in test_out) + self.assertTrue("CREATED:20101010T081010Z" in test_out) def test_create_to_ical_zoneinfo(self): cal = icalendar.Calendar() @@ -232,21 +232,21 @@ def test_create_to_ical_zoneinfo(self): test_out = test_out.decode('utf-8') vtimezone_lines = "BEGIN:VTIMEZONE|TZID:Europe/Vienna|X-LIC-LOCATION:" - "Europe/Vienna|BEGIN:STANDARD|DTSTART;VALUE=DATE-TIME:19701025T03" + "Europe/Vienna|BEGIN:STANDARD|DTSTART:19701025T03" "0000|RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10|RRULE:FREQ=YEARLY;B" "YDAY=-1SU;BYMONTH=3|TZNAME:CET|TZOFFSETFROM:+0200|TZOFFSETTO:+01" - "00|END:STANDARD|BEGIN:DAYLIGHT|DTSTART;VALUE=DATE-TIME:19700329T" + "00|END:STANDARD|BEGIN:DAYLIGHT|DTSTART:19700329T" "020000|TZNAME:CEST|TZOFFSETFROM:+0100|TZOFFSETTO:+0200|END:DAYLI" "GHT|END:VTIMEZONE" self.assertTrue(vtimezone_lines in test_out) - test_str = "DTSTART;TZID=Europe/Vienna;VALUE=DATE-TIME:20120213T100000" + test_str = "DTSTART;TZID=Europe/Vienna:20120213T100000" self.assertTrue(test_str in test_out) self.assertTrue("ATTENDEE:sepp" in test_out) # ical standard expects DTSTAMP and CREATED in UTC - self.assertTrue("DTSTAMP;VALUE=DATE-TIME:20101010T081010Z" in test_out) - self.assertTrue("CREATED;VALUE=DATE-TIME:20101010T081010Z" in test_out) + self.assertTrue("DTSTAMP:20101010T081010Z" in test_out) + self.assertTrue("CREATED:20101010T081010Z" in test_out) def test_tzinfo_dateutil(self): diff --git a/src/icalendar/tests/test_unit_cal.py b/src/icalendar/tests/test_unit_cal.py index f1e4bc81..3d09f046 100644 --- a/src/icalendar/tests/test_unit_cal.py +++ b/src/icalendar/tests/test_unit_cal.py @@ -227,12 +227,12 @@ def test_cal_Component_add(self): lines = comp.to_ical().splitlines() self.assertTrue( - b"DTSTART;TZID=Europe/Vienna;VALUE=DATE-TIME:20101010T100000" + b"DTSTART;TZID=Europe/Vienna:20101010T100000" in lines) - self.assertTrue(b"CREATED;VALUE=DATE-TIME:20101010T120000Z" in lines) - self.assertTrue(b"DTSTAMP;VALUE=DATE-TIME:20101010T120000Z" in lines) + self.assertTrue(b"CREATED:20101010T120000Z" in lines) + self.assertTrue(b"DTSTAMP:20101010T120000Z" in lines) self.assertTrue( - b"LAST-MODIFIED;VALUE=DATE-TIME:20101010T160000Z" in lines + b"LAST-MODIFIED:20101010T160000Z" in lines ) def test_cal_Component_add_no_reencode(self): @@ -388,7 +388,7 @@ def test_cal_Calendar(self): self.assertEqual( cal.subcomponents[0].to_ical(), b'BEGIN:VEVENT\r\nSUMMARY:Python meeting about calendaring\r\n' - + b'DTSTART;VALUE=DATE-TIME:20050404T080000\r\nUID:42\r\n' + + b'DTSTART:20050404T080000\r\nUID:42\r\n' + b'END:VEVENT\r\n') # Write to disc