several updates to functionality
This commit is contained in:
25
tests/test_html_injection.py
Normal file
25
tests/test_html_injection.py
Normal file
@@ -0,0 +1,25 @@
|
||||
import unittest
|
||||
|
||||
from generator import inject_outlook_hacks
|
||||
|
||||
|
||||
class HtmlInjectionTest(unittest.TestCase):
|
||||
def test_html_injection_adds_folded_alt_desc(self) -> None:
|
||||
ical_text = "\n".join(
|
||||
[
|
||||
"BEGIN:VCALENDAR",
|
||||
"BEGIN:VEVENT",
|
||||
"UID:abc123",
|
||||
"END:VEVENT",
|
||||
"END:VCALENDAR",
|
||||
]
|
||||
)
|
||||
long_html = "A" * 200
|
||||
result = inject_outlook_hacks(ical_text, {"abc123": long_html})
|
||||
|
||||
self.assertIn("X-ALT-DESC;FMTTYPE=text/html:", result)
|
||||
self.assertIn("X-MICROSOFT-CDO-BUSYSTATUS:BUSY", result)
|
||||
self.assertIn("TRANSP:OPAQUE", result)
|
||||
alt_index = result.find("X-ALT-DESC;FMTTYPE=text/html:")
|
||||
self.assertNotEqual(alt_index, -1)
|
||||
self.assertIn("\r\n ", result[alt_index : alt_index + 200])
|
||||
Reference in New Issue
Block a user