]> jfr.im git - yt-dlp.git/blobdiff - test/test_YoutubeDLCookieJar.py
[cookies] Move `YoutubeDLCookieJar` to cookies module (#7091)
[yt-dlp.git] / test / test_YoutubeDLCookieJar.py
index 0d4e7dc97c482504e2f3402bdfaee1b48fa62a62..2c73d7d85341a2733d9e1ba3a8f3a53d100344ec 100644 (file)
@@ -11,7 +11,7 @@
 import re
 import tempfile
 
-from yt_dlp.utils import YoutubeDLCookieJar
+from yt_dlp.cookies import YoutubeDLCookieJar
 
 
 class TestYoutubeDLCookieJar(unittest.TestCase):
@@ -47,6 +47,12 @@ def test_malformed_cookies(self):
         # 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()