about summary refs log tree commit diff
path: root/test/test_YoutubeDLCookieJar.py
diff options
context:
space:
mode:
authorremitamine <remitamine@gmail.com>2019-03-03 13:23:59 +0100
committerSergey M <dstftw@gmail.com>2019-03-03 19:23:59 +0700
commite7e62441cdde6dca6211c073be73677f195a0dff (patch)
tree7d30bd0a1df72032af32234c5fe2862e56f0766c /test/test_YoutubeDLCookieJar.py
parent0a5baf9c210df9f492ae48dd8fdae90561c971bd (diff)
downloadyoutube-dl-e7e62441cdde6dca6211c073be73677f195a0dff.tar.gz
youtube-dl-e7e62441cdde6dca6211c073be73677f195a0dff.tar.xz
youtube-dl-e7e62441cdde6dca6211c073be73677f195a0dff.zip
[utils] strip #HttpOnly_ prefix from cookies files (#20219)
Diffstat (limited to 'test/test_YoutubeDLCookieJar.py')
-rw-r--r--test/test_YoutubeDLCookieJar.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/test_YoutubeDLCookieJar.py b/test/test_YoutubeDLCookieJar.py
index 6a8243590..f959798de 100644
--- a/test/test_YoutubeDLCookieJar.py
+++ b/test/test_YoutubeDLCookieJar.py
@@ -29,6 +29,16 @@ class TestYoutubeDLCookieJar(unittest.TestCase):
             tf.close()
             os.remove(tf.name)
 
+    def test_strip_httponly_prefix(self):
+        cookiejar = YoutubeDLCookieJar('./test/testdata/cookies/httponly_cookies.txt')
+        cookiejar.load(ignore_discard=True, ignore_expires=True)
+
+        def assert_cookie_has_value(key):
+            self.assertEqual(cookiejar._cookies['www.foobar.foobar']['/'][key].value, key + '_VALUE')
+
+        assert_cookie_has_value('HTTPONLY_COOKIE')
+        assert_cookie_has_value('JS_ACCESSIBLE_COOKIE')
+
 
 if __name__ == '__main__':
     unittest.main()