Files
syn-chat-bot/.venv/lib/python3.9/site-packages/icalendar/tests/attr/test_alarm.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

55 lines
1.1 KiB
Python

"""Test the properties of the alarm."""
import pytest
from icalendar.cal import Alarm
from icalendar.error import InvalidCalendar
def test_repeat_absent():
"""Test the absence of REPEAT."""
assert Alarm().REPEAT == 0
def test_repeat_number():
"""Test the absence of REPEAT."""
assert Alarm({"REPEAT": 10}).REPEAT == 10
def test_set_REPEAT():
"""Check setting the value."""
a = Alarm()
a.REPEAT = 10
assert a.REPEAT == 10
def test_set_REPEAT_twice():
"""Check setting the value."""
a = Alarm()
a.REPEAT = 10
a.REPEAT = 20
assert a.REPEAT == 20
def test_add_REPEAT():
"""Check setting the value."""
a = Alarm()
a.add("REPEAT", 10)
assert a.REPEAT == 10
def test_invalid_repeat_value():
"""Check setting the value."""
a = Alarm()
with pytest.raises(ValueError):
a.REPEAT = "asd"
a["REPEAT"] = "asd"
with pytest.raises(InvalidCalendar):
a.REPEAT # noqa: B018
def test_alarm_to_string():
a = Alarm()
a.REPEAT = 11
assert a.to_ical() == b"BEGIN:VALARM\r\nREPEAT:11\r\nEND:VALARM\r\n"