diff --git a/news/1062.chore b/news/1062.chore new file mode 100644 index 000000000..82983137d --- /dev/null +++ b/news/1062.chore @@ -0,0 +1 @@ +Made the RFC 6868 parameter tests expect the platform newline so they pass on Windows. Reviewed by GPT-6 Luna. :user:`SemTiOne` diff --git a/src/icalendar/tests/test_issue_1445.py b/src/icalendar/tests/test_issue_1445.py index ffec847a7..cf3255f9f 100644 --- a/src/icalendar/tests/test_issue_1445.py +++ b/src/icalendar/tests/test_issue_1445.py @@ -15,6 +15,8 @@ :class:`~icalendar.prop.text.vText`, but shares its plumbing. """ +import os + import pytest from icalendar.cal import Component @@ -158,12 +160,13 @@ def test_unrecognized_parameter_is_decoded_not_verbatim(): assert str(prop) == "val;ue" # parameters: decoded, not verbatim + newline = os.linesep # RFC 6868 ^n decodes to the platform newline assert prop.params["X-ROAST"] == "a,b;c" # de-quoted - assert prop.params["X-NOTE"] == "line1\nline2" # RFC 6868 ^n -> newline + assert prop.params["X-NOTE"] == f"line1{newline}line2" assert ev.to_jcal()[1][1] == [ "x-foo", - {"x-roast": "a,b;c", "x-note": "line1\nline2"}, + {"x-roast": "a,b;c", "x-note": f"line1{newline}line2"}, "unknown", "val;ue", ] diff --git a/src/icalendar/tests/test_rfc_6868.py b/src/icalendar/tests/test_rfc_6868.py index 32556aac3..870946e0f 100644 --- a/src/icalendar/tests/test_rfc_6868.py +++ b/src/icalendar/tests/test_rfc_6868.py @@ -33,7 +33,7 @@ def test_all_parameters(calendars, duplicate): """Check that all examples get decoded correctly.""" cal: Calendar = duplicate(calendars.rfc_6868) param = cal["X-PARAM"].params["ALL"] - assert param == '^"\n' + assert param == '^"' + os.linesep @param_duplicate