def testHmm(self): from icalendar.parser import Contentlines, Contentline c = Contentlines([Contentline('BEGIN:VEVENT\r\n')]) c.append(Contentline(''.join(['123456789 ']*10)+'\r\n')) output = str(c) self.assertEqual(output, 'BEGIN:VEVENT\r\n\r\n123456789 123456789 123456789 123456789 123456789 123456789 123456789 1234\r\n 56789 123456789 123456789 \r\n')
def XtestLongLine(self): from icalendar.parser import Contentlines, Contentline c = Contentlines([Contentline('BEGIN:VEVENT\\r\\n')]) c.append(Contentline(''.join(['123456789 ']*10)+'\\r\\n')) import pdb ; pdb.set_trace() output = str(c) self.assertEqual(output, "BEGIN:VEVENT\\r\\n\\r\\n123456789 123456789 123456789 123456789 123456789 123456789 123456789 1234\\r\\n 56789 123456789 123456789 \\r\\n")
def test_long_lines(self): from icalendar.parser import Contentlines, Contentline c = Contentlines([Contentline('BEGIN:VEVENT\r\n')]) c.append(Contentline(''.join('123456789 ' * 10) + '\r\n')) self.assertEqual( c.to_ical(), 'BEGIN:VEVENT\r\n\r\n123456789 123456789 123456789 123456789 ' '123456789 123456789 123456789 1234\r\n 56789 123456789 ' '123456789 \r\n\r\n')
def XtestLongLine(self): from icalendar.parser import Contentlines, Contentline c = Contentlines([Contentline('BEGIN:VEVENT\\r\\n')]) c.append(Contentline(''.join(['123456789 '] * 10) + '\\r\\n')) output = c.to_ical() cmp = ("BEGIN:VEVENT\\r\\n\\r\\n123456789 123456789 123456789 " "123456789 123456789 123456789 123456789 1234\\r\\n 56789 " "123456789 123456789 \\r\\n") self.assertEqual(output, cmp)
def testHmm(self): from icalendar.parser import Contentlines, Contentline c = Contentlines([Contentline('BEGIN:VEVENT\r\n')]) c.append(Contentline(''.join(['123456789 '] * 10) + '\r\n')) output = c.to_ical() # XXX: sure? looks weird in conjunction with generated content above. #cmp = ('BEGIN:VEVENT\r\n\r\n123456789 123456789 123456789 123456789 ' # '123456789 123456789 123456789 1234\r\n 56789 123456789 ' # '123456789 \r\n') cmp = ('BEGIN:VEVENT\r\n\r\n123456789 123456789 123456789 123456789 ' '123456789 123456789 123456789 \r\n 123456789 123456789 ' '123456789 \r\n\r\n') self.assertEqual(output, cmp)
def XtestTrailingNewline(self): from icalendar.parser import Contentlines, Contentline c = Contentlines([Contentline('BEGIN:VEVENT\\r\\n')]) output = str(c) self.assertEqual(output, 'BEGIN:VEVENT\\r\\n')