Files
syn-chat-bot/.venv/lib/python3.9/site-packages/icalendar/tests/prop/test_vCalAddress.py
Hyungi Ahn c2257d3a86 fix: 포트 충돌 회피 — note_bridge 8098, intent_service 8099
Jellyfin(8096), OrbStack(8097) 포트 충돌으로 변경.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 13:53:55 +09:00

58 lines
1.4 KiB
Python

from icalendar.parser import Parameters
from icalendar.prop import vCalAddress
txt = b"MAILTO:maxm@mxm.dk"
a = vCalAddress(txt)
a.params["cn"] = "Max M"
def test_to_ical():
assert a.to_ical() == txt
def test_params():
assert isinstance(a.params, Parameters)
assert a.params == {"CN": "Max M"}
def test_from_ical():
assert vCalAddress.from_ical(txt) == "MAILTO:maxm@mxm.dk"
def test_repr():
instance = vCalAddress("value")
assert repr(instance) == "vCalAddress('value')"
def test_email_malformed():
"""Sometimes, people forget to add mailto that."""
address = vCalAddress("me@you.we")
assert address.email == "me@you.we"
def test_email_mailto():
"""Email with a normal mailto link."""
address = vCalAddress("mailto:icalendar@email.list")
assert address.email == "icalendar@email.list"
def test_capital_email():
"""mailto can be capital letters."""
address = vCalAddress("MAILTO:yemaya@posteo.net")
assert address.email == "yemaya@posteo.net"
def test_name():
"""We want the name, too!"""
address = vCalAddress("MAILTO:yemaya@posteo.net")
assert address.name == ""
address.params["CN"] = "name!"
assert address.name == "name!"
def test_set_the_name():
address = vCalAddress("MAILTO:yemaya@posteo.net")
address.name = "Yemaya :)"
assert address.name == "Yemaya :)"
assert address.params["CN"] == "Yemaya :)"