kopia lustrzana https://github.com/collective/icalendar
restructure test_issue_82
rodzic
6e78ab6a3b
commit
7352251bf6
|
@ -0,0 +1,3 @@
|
|||
BEGIN:VEVENT
|
||||
ATTACH;ENCODING=BASE64;FMTTYPE=text/plain;VALUE=BINARY:dGV4dA==
|
||||
END:VEVENT
|
|
@ -129,23 +129,6 @@ END:VEVENT"""
|
|||
b'FREQ=WEEKLY;UNTIL=20070619T225959;INTERVAL=1'
|
||||
)
|
||||
|
||||
def test_issue_82(self):
|
||||
"""Issue #82 - vBinary __repr__ called rather than to_ical from
|
||||
container types
|
||||
https://github.com/collective/icalendar/issues/82
|
||||
"""
|
||||
|
||||
b = icalendar.vBinary('text')
|
||||
b.params['FMTTYPE'] = 'text/plain'
|
||||
self.assertEqual(b.to_ical(), b'dGV4dA==')
|
||||
e = icalendar.Event()
|
||||
e.add('ATTACH', b)
|
||||
self.assertEqual(
|
||||
e.to_ical(),
|
||||
b"BEGIN:VEVENT\r\nATTACH;ENCODING=BASE64;FMTTYPE=text/plain;"
|
||||
b"VALUE=BINARY:dGV4dA==\r\nEND:VEVENT\r\n"
|
||||
)
|
||||
|
||||
def test_issue_100(self):
|
||||
"""Issue #100 - Transformed doctests into unittests, Test fixes and
|
||||
cleanup.
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
import base64
|
||||
|
||||
from icalendar import Event, vBinary
|
||||
|
||||
def test_vBinary_base64_encoded_issue_82():
|
||||
'''Issue #82 - vBinary __repr__ called rather than to_ical from
|
||||
container types
|
||||
https://github.com/collective/icalendar/issues/82
|
||||
'''
|
||||
b = vBinary('text')
|
||||
b.params['FMTTYPE'] = 'text/plain'
|
||||
assert b.to_ical() == base64.b64encode(b'text')
|
||||
|
||||
def test_creates_event_with_base64_encoded_attachment_issue_82(events):
|
||||
'''Issue #82 - vBinary __repr__ called rather than to_ical from
|
||||
container types
|
||||
https://github.com/collective/icalendar/issues/82
|
||||
'''
|
||||
b = vBinary('text')
|
||||
b.params['FMTTYPE'] = 'text/plain'
|
||||
event = Event()
|
||||
event.add('ATTACH', b)
|
||||
assert event.to_ical() == events.issue_82_expected_output.raw_ics
|
Ładowanie…
Reference in New Issue