several updates to functionality

This commit is contained in:
2026-02-02 13:16:18 +01:00
parent 1f3ba037d6
commit 3ac987ac34
19 changed files with 1808 additions and 135 deletions

View 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])