aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorcoletdjnz <coletdjnz@protonmail.com>2023-05-27 19:08:19 +1200
committerGitHub <noreply@github.com>2023-05-27 07:08:19 +0000
commitb87e01c123fd560b6a674ce00f45a9459d82d98a (patch)
treecb735612a6c52e6bcf994f50869063503e7fcc68 /test
parent08916a49c777cb6e000eec092881eb93ec22076c (diff)
downloadhypervideo-pre-b87e01c123fd560b6a674ce00f45a9459d82d98a.tar.lz
hypervideo-pre-b87e01c123fd560b6a674ce00f45a9459d82d98a.tar.xz
hypervideo-pre-b87e01c123fd560b6a674ce00f45a9459d82d98a.zip
[cookies] Move `YoutubeDLCookieJar` to cookies module (#7091)
Authored by: coletdjnz
Diffstat (limited to 'test')
-rw-r--r--test/test_YoutubeDLCookieJar.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/test/test_YoutubeDLCookieJar.py b/test/test_YoutubeDLCookieJar.py
index 0d4e7dc97..2c73d7d85 100644
--- a/test/test_YoutubeDLCookieJar.py
+++ b/test/test_YoutubeDLCookieJar.py
@@ -11,7 +11,7 @@ sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import re
import tempfile
-from yt_dlp.utils import YoutubeDLCookieJar
+from yt_dlp.cookies import YoutubeDLCookieJar
class TestYoutubeDLCookieJar(unittest.TestCase):
@@ -47,6 +47,12 @@ class TestYoutubeDLCookieJar(unittest.TestCase):
# will be ignored
self.assertFalse(cookiejar._cookies)
+ def test_get_cookie_header(self):
+ cookiejar = YoutubeDLCookieJar('./test/testdata/cookies/httponly_cookies.txt')
+ cookiejar.load(ignore_discard=True, ignore_expires=True)
+ header = cookiejar.get_cookie_header('https://www.foobar.foobar')
+ self.assertIn('HTTPONLY_COOKIE', header)
+
if __name__ == '__main__':
unittest.main()