diff options
author | Trygve Aaberge <trygveaa@gmail.com> | 2024-01-06 16:32:14 +0100 |
---|---|---|
committer | Trygve Aaberge <trygveaa@gmail.com> | 2024-02-18 11:32:54 +0100 |
commit | af2c56f96d8be2f783332f5e4c502e8d15835b32 (patch) | |
tree | 66a7620e5ef5a288f0f17e0cb9473a2188cbce79 /tests/test_get_cookies.py | |
parent | 30e500d4067a161a3e6ea3161ff3440b6959d263 (diff) | |
download | wee-slack-af2c56f96d8be2f783332f5e4c502e8d15835b32.tar.gz |
URL encode cookies if not encoded
The cookies need to be encoded for the Slack API to accept them, so this
makes it work if the config is set with cookies that are not encoded.
Diffstat (limited to 'tests/test_get_cookies.py')
-rw-r--r-- | tests/test_get_cookies.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/test_get_cookies.py b/tests/test_get_cookies.py new file mode 100644 index 0000000..1e68f58 --- /dev/null +++ b/tests/test_get_cookies.py @@ -0,0 +1,11 @@ +from slack.util import get_cookies + + +def test_get_cookies_multiple_keys_value_encoded(): + cookie = get_cookies("d=a%2Bb ; d-s=1") + assert cookie == "d=a%2Bb; d-s=1" + + +def test_get_cookies_multiple_keys_value_not_encoded(): + cookie = get_cookies("d=a+b ; d-s=1") + assert cookie == "d=a%2Bb; d-s=1" |