Skip to content

Commit 02a88f1

Browse files
style: remove section-label comments from JMAP test files
1 parent b1f4b55 commit 02a88f1

2 files changed

Lines changed: 0 additions & 78 deletions

File tree

tests/test_jmap_integration.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@
2323
from caldav.jmap.constants import CALENDAR_CAPABILITY
2424
from caldav.jmap.session import fetch_session
2525

26-
# ---------------------------------------------------------------------------
27-
# Skip the whole module if Cyrus is not reachable
28-
# ---------------------------------------------------------------------------
29-
3026
CYRUS_HOST = "localhost"
3127
CYRUS_PORT = 8802
3228
JMAP_URL = f"http://{CYRUS_HOST}:{CYRUS_PORT}/.well-known/jmap"
@@ -50,10 +46,6 @@ def _cyrus_reachable() -> bool:
5046
"start it with: docker-compose -f tests/docker-test-servers/cyrus/docker-compose.yml up -d",
5147
)
5248

53-
# ---------------------------------------------------------------------------
54-
# Fixtures
55-
# ---------------------------------------------------------------------------
56-
5749

5850
@pytest.fixture(scope="module")
5951
def client():
@@ -65,11 +57,6 @@ def session():
6557
return fetch_session(JMAP_URL, auth=HTTPBasicAuth(CYRUS_USERNAME, CYRUS_PASSWORD))
6658

6759

68-
# ---------------------------------------------------------------------------
69-
# Session
70-
# ---------------------------------------------------------------------------
71-
72-
7360
class TestJMAPSessionIntegration:
7461
def test_session_fetch_returns_api_url(self, session):
7562
assert session.api_url
@@ -82,11 +69,6 @@ def test_session_has_calendar_capability(self, session):
8269
assert CALENDAR_CAPABILITY in session.account_capabilities
8370

8471

85-
# ---------------------------------------------------------------------------
86-
# Calendar listing
87-
# ---------------------------------------------------------------------------
88-
89-
9072
class TestJMAPCalendarListIntegration:
9173
def test_list_calendars_returns_list(self, client):
9274
calendars = client.get_calendars()

tests/test_jmap_unit.py

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,11 @@
1414
except 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-
3022
from 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-
9684
from caldav.jmap.constants import CALENDAR_CAPABILITY, TASK_CAPABILITY
9785
from 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-
226210
from 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-
307287
from 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-
362338
from 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-
478450
from 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-
507475
from 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-
753717
from 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

979939
def _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-
1008963
class 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-
10581008
class TestIcalToJscal:
10591009
def test_minimal_event(self):
10601010
ical = _make_ical("DTSTART:20240615T100000Z\r\nDURATION:PT1H\r\nSUMMARY: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-
13291274
class 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-
14911431
class TestRoundTrip:
14921432
def _key_fields_survive(self, original_ical: str) -> dict:
14931433
"""ical → jscal → ical → parse back and check."""

0 commit comments

Comments
 (0)