1414except ImportError :
1515 from requests .auth import HTTPBasicAuth # type: ignore[no-redef]
1616
17- # ---------------------------------------------------------------------------
18- # Shared test fixtures (module-level constants — not hardcoded inline)
19- # ---------------------------------------------------------------------------
20-
2117_JMAP_URL = "http://localhost:8802/.well-known/jmap"
2218_API_URL = "http://localhost:8802/jmap/api"
2319_USERNAME = "user1"
2420_PASSWORD = "x"
2521
26- # ---------------------------------------------------------------------------
27- # Error hierarchy
28- # ---------------------------------------------------------------------------
29-
3022from caldav .jmap .error import (
3123 JMAPAuthError ,
3224 JMAPCapabilityError ,
@@ -89,10 +81,6 @@ def test_jmap_auth_error_catchable_as_authorization_error(self):
8981 raise JMAPAuthError ()
9082
9183
92- # ---------------------------------------------------------------------------
93- # Session establishment
94- # ---------------------------------------------------------------------------
95-
9684from caldav .jmap .constants import CALENDAR_CAPABILITY , TASK_CAPABILITY
9785from caldav .jmap .session import Session , fetch_session
9886
@@ -219,10 +207,6 @@ def test_picks_first_calendar_capable_account(self):
219207 assert session .account_id == "user_calendar"
220208
221209
222- # ---------------------------------------------------------------------------
223- # Calendar domain object
224- # ---------------------------------------------------------------------------
225-
226210from caldav .jmap .objects .calendar import JMAPCalendar
227211
228212_CALENDAR_JSON_FULL = {
@@ -300,10 +284,6 @@ def test_from_jmap_raises_when_name_missing(self):
300284 JMAPCalendar .from_jmap ({"id" : "cal3" })
301285
302286
303- # ---------------------------------------------------------------------------
304- # Calendar method builders and parsers
305- # ---------------------------------------------------------------------------
306-
307287from caldav .jmap .methods .calendar import (
308288 build_calendar_changes ,
309289 build_calendar_get ,
@@ -355,10 +335,6 @@ def test_build_calendar_changes_structure(self):
355335 assert isinstance (call_id , str )
356336
357337
358- # ---------------------------------------------------------------------------
359- # JMAPClient
360- # ---------------------------------------------------------------------------
361-
362338from caldav .jmap .client import JMAPClient
363339
364340_CALENDAR_GET_RESPONSE = {
@@ -471,10 +447,6 @@ def test_request_raises_method_error_on_error_response(self, monkeypatch):
471447 assert exc_info .value .error_type == "unknownMethod"
472448
473449
474- # ---------------------------------------------------------------------------
475- # get_jmap_client factory
476- # ---------------------------------------------------------------------------
477-
478450from caldav .jmap import get_jmap_client
479451
480452
@@ -500,10 +472,6 @@ def test_strips_caldav_only_keys(self, monkeypatch):
500472 assert not hasattr (client , "ssl_verify_cert" )
501473
502474
503- # ---------------------------------------------------------------------------
504- # CalendarEvent domain object
505- # ---------------------------------------------------------------------------
506-
507475from caldav .jmap .objects .event import JMAPEvent
508476
509477_EVENT_JSON_FULL = {
@@ -746,10 +714,6 @@ def test_from_jmap_explicit_empty_collections_are_empty(self):
746714 assert ev .recurrence_overrides == {}
747715
748716
749- # ---------------------------------------------------------------------------
750- # CalendarEvent method builders and parsers
751- # ---------------------------------------------------------------------------
752-
753717from caldav .jmap .methods .event import (
754718 build_event_changes ,
755719 build_event_get ,
@@ -971,10 +935,6 @@ def test_parse_event_set_partial_failure(self):
971935 _timedelta_to_duration ,
972936)
973937
974- # ---------------------------------------------------------------------------
975- # Shared iCal fixtures
976- # ---------------------------------------------------------------------------
977-
978938
979939def _make_ical (extra_lines : str = "" , uid : str = "test-uid@example.com" ) -> str :
980940 return (
@@ -1000,11 +960,6 @@ def _minimal_jscal(**kwargs) -> dict:
1000960 return base
1001961
1002962
1003- # ---------------------------------------------------------------------------
1004- # TestUtils — shared utility functions
1005- # ---------------------------------------------------------------------------
1006-
1007-
1008963class TestUtils :
1009964 def test_timedelta_to_duration_hours (self ):
1010965 assert _timedelta_to_duration (timedelta (hours = 1 , minutes = 30 )) == "PT1H30M"
@@ -1050,11 +1005,6 @@ def test_format_local_dt_date(self):
10501005 assert _format_local_dt (d ) == "2024-06-15T00:00:00"
10511006
10521007
1053- # ---------------------------------------------------------------------------
1054- # TestIcalToJscal
1055- # ---------------------------------------------------------------------------
1056-
1057-
10581008class TestIcalToJscal :
10591009 def test_minimal_event (self ):
10601010 ical = _make_ical ("DTSTART:20240615T100000Z\r \n DURATION:PT1H\r \n SUMMARY:Test Event\r \n " )
@@ -1321,11 +1271,6 @@ def test_rrule_missing_freq_raises(self):
13211271 ical_to_jscal (ical )
13221272
13231273
1324- # ---------------------------------------------------------------------------
1325- # TestJscalToIcal
1326- # ---------------------------------------------------------------------------
1327-
1328-
13291274class TestJscalToIcal :
13301275 def test_minimal_event (self ):
13311276 jscal = _minimal_jscal ()
@@ -1483,11 +1428,6 @@ def test_floating_datetime_emitted(self):
14831428 assert "TZID" not in result
14841429
14851430
1486- # ---------------------------------------------------------------------------
1487- # TestRoundTrip
1488- # ---------------------------------------------------------------------------
1489-
1490-
14911431class TestRoundTrip :
14921432 def _key_fields_survive (self , original_ical : str ) -> dict :
14931433 """ical → jscal → ical → parse back and check."""
0 commit comments