Skip to content

Commit

Permalink
restructure test_issue_70
Browse files Browse the repository at this point in the history
  • Loading branch information
jacadzaca committed Sep 11, 2022
1 parent 6e78ab6 commit fdd275a
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 26 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
BEGIN:VEVENT
CREATED:20081114T072804Z
UID:D449CA84-00A3-4E55-83E1-34B58268853B
DTEND:20070220T180000
RRULE:FREQ=WEEKLY;INTERVAL=1;UNTIL=20070619T225959
TRANSP:OPAQUE
SUMMARY:Esb mellon phone conf
DTSTART:20070220T170000
DTSTAMP:20070221T095412Z
SEQUENCE:0
END:VEVENT

26 changes: 0 additions & 26 deletions src/icalendar/tests/test_fixed_issues.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
from backports import zoneinfo

class TestIssues(unittest.TestCase):

def test_issue_53(self):
"""Issue #53 - Parsing failure on some descriptions?
https://github.com/collective/icalendar/issues/53
Expand Down Expand Up @@ -104,31 +103,6 @@ def test_issue_64(self):
b"DTSTART;VALUE=DATE-TIME:20120903T000000\r\nEND:VEVENT\r\n"
)

def test_issue_70(self):
"""Issue #70 - e.decode("RRULE") causes Attribute Error
https://github.com/collective/icalendar/issues/70
"""

ical_str = """BEGIN:VEVENT
CREATED:20081114T072804Z
UID:D449CA84-00A3-4E55-83E1-34B58268853B
DTEND:20070220T180000
RRULE:FREQ=WEEKLY;INTERVAL=1;UNTIL=20070619T225959
TRANSP:OPAQUE
SUMMARY:Esb mellon phone conf
DTSTART:20070220T170000
DTSTAMP:20070221T095412Z
SEQUENCE:0
END:VEVENT"""

cal = icalendar.Calendar.from_ical(ical_str)
recur = cal.decoded("RRULE")
self.assertIsInstance(recur, icalendar.vRecur)
self.assertEqual(
recur.to_ical(),
b'FREQ=WEEKLY;UNTIL=20070619T225959;INTERVAL=1'
)

def test_issue_82(self):
"""Issue #82 - vBinary __repr__ called rather than to_ical from
container types
Expand Down
10 changes: 10 additions & 0 deletions src/icalendar/tests/test_parsing.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
'''Tests checking that parsing works'''
from icalendar import vRecur

def test_decode_rrule_attribute_error_issue_70(events):
# Issue #70 - e.decode("RRULE") causes Attribute Error
# see https://github.com/collective/icalendar/issues/70
recur = events.issue_70_rrule_causes_attribute_error.decoded('RRULE')
assert isinstance(recur, vRecur)
assert recur.to_ical() == b'FREQ=WEEKLY;UNTIL=20070619T225959;INTERVAL=1'

0 comments on commit fdd275a

Please sign in to comment.