Skip to content

Commit 5d74702

Browse files
[PR #12350/7eb05774 backport][3.13] Fix octal tests (#12401)
**This is a backport of PR #12350 as merged into master (7eb0577).** Co-authored-by: Sam Bull <git@sambull.org>
1 parent 83a85fa commit 5d74702

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

tests/test_cookie_helpers.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1095,13 +1095,13 @@ def test_parse_set_cookie_headers_date_formats_with_attributes() -> None:
10951095
@pytest.mark.parametrize(
10961096
("header", "expected_name", "expected_value", "expected_coded"),
10971097
[
1098-
# Test cookie values with octal escape sequences
1099-
(r'name="\012newline\012"', "name", "\nnewline\n", r'"\012newline\012"'),
1098+
# Test cookie values with octal escape sequences (printable chars only)
1099+
(r'name="\050parens\051"', "name", "(parens)", r'"\050parens\051"'),
11001100
(
1101-
r'tab="\011separated\011values"',
1102-
"tab",
1103-
"\tseparated\tvalues",
1104-
r'"\011separated\011values"',
1101+
r'punct="\053plus\053values"',
1102+
"punct",
1103+
"+plus+values",
1104+
r'"\053plus\053values"',
11051105
),
11061106
(
11071107
r'mixed="hello\040world\041"',
@@ -1110,10 +1110,10 @@ def test_parse_set_cookie_headers_date_formats_with_attributes() -> None:
11101110
r'"hello\040world\041"',
11111111
),
11121112
(
1113-
r'complex="\042quoted\042 text with \012 newline"',
1113+
r'complex="\042quoted\042 text with \055 hyphen"',
11141114
"complex",
1115-
'"quoted" text with \n newline',
1116-
r'"\042quoted\042 text with \012 newline"',
1115+
'"quoted" text with - hyphen',
1116+
r'"\042quoted\042 text with \055 hyphen"',
11171117
),
11181118
],
11191119
)

0 commit comments

Comments
 (0)