aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_cookies.py
diff options
context:
space:
mode:
authorSimon Sawicki <37424085+Grub4K@users.noreply.github.com>2022-10-11 05:39:12 +0200
committerGitHub <noreply@github.com>2022-10-11 09:09:12 +0530
commit36069409ec7ed88f7571f29ff35a5a4c62b70cfc (patch)
treedfc20f2acf081170fdc99e703d63ea8f5bc29c59 /test/test_cookies.py
parent0468a3b3253957bfbeb98b4a7c71542ff80e9e06 (diff)
downloadhypervideo-pre-36069409ec7ed88f7571f29ff35a5a4c62b70cfc.tar.lz
hypervideo-pre-36069409ec7ed88f7571f29ff35a5a4c62b70cfc.tar.xz
hypervideo-pre-36069409ec7ed88f7571f29ff35a5a4c62b70cfc.zip
[cookies] Improve `LenientSimpleCookie` (#5195)
Closes #5186 Authored by: Grub4K
Diffstat (limited to 'test/test_cookies.py')
-rw-r--r--test/test_cookies.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/test_cookies.py b/test/test_cookies.py
index 61619df29..4155bcbf5 100644
--- a/test/test_cookies.py
+++ b/test/test_cookies.py
@@ -278,8 +278,23 @@ class TestLenientSimpleCookie(unittest.TestCase):
{"a": "b", "c": "d"},
),
(
+ "Reset morsel after invalid to not capture attributes",
+ "a=b; $invalid; $Version=1; c=d",
+ {"a": "b", "c": "d"},
+ ),
+ (
"Continue after non-flag attribute without value",
"a=b; path; Version=1; c=d",
{"a": "b", "c": "d"},
),
+ (
+ "Allow cookie attributes with `$` prefix",
+ 'Customer="WILE_E_COYOTE"; $Version=1; $Secure; $Path=/acme',
+ {"Customer": ("WILE_E_COYOTE", {"version": "1", "secure": True, "path": "/acme"})},
+ ),
+ (
+ "Invalid Morsel keys should not result in an error",
+ "Key=Value; [Invalid]=Value; Another=Value",
+ {"Key": "Value", "Another": "Value"},
+ ),
)