28 lines
891 B
Python
28 lines
891 B
Python
from __future__ import annotations
|
|
|
|
import unittest
|
|
from datetime import datetime, timezone
|
|
|
|
from govoplan_calendar.backend.capabilities import SqlCalendarSchedulingProvider
|
|
from govoplan_core.core.calendar import CalendarCapabilityError, CalendarEventRequest
|
|
|
|
|
|
class CalendarSchedulingCapabilityTests(unittest.TestCase):
|
|
def test_event_request_validation_is_exposed_as_capability_error(self) -> None:
|
|
provider = SqlCalendarSchedulingProvider()
|
|
|
|
with self.assertRaises(CalendarCapabilityError):
|
|
provider.create_event(
|
|
object(),
|
|
tenant_id="tenant-1",
|
|
user_id="user-1",
|
|
request=CalendarEventRequest(
|
|
summary="x" * 501,
|
|
start_at=datetime(2026, 7, 20, 9, tzinfo=timezone.utc),
|
|
),
|
|
)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|