Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions news/1062.chore
Original file line number Diff line number Diff line change
@@ -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`
7 changes: 5 additions & 2 deletions src/icalendar/tests/test_issue_1445.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
:class:`~icalendar.prop.text.vText`, but shares its plumbing.
"""

import os

import pytest

from icalendar.cal import Component
Expand Down Expand Up @@ -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",
]
Expand Down
2 changes: 1 addition & 1 deletion src/icalendar/tests/test_rfc_6868.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down