aboutsummaryrefslogtreecommitdiff
path: root/test/test_YoutubeDLCookieJar.py
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2020-03-10 04:51:20 +0700
committerSergey M․ <dstftw@gmail.com>2020-03-10 04:53:51 +0700
commit042b66493398dd8c3bb31216e3f828b98716810d (patch)
tree2763e8d8c8d40a358d522a140f0581d4fc5aa11f /test/test_YoutubeDLCookieJar.py
parent68fa15155f40f7d646079e6649df03696a5e7d4b (diff)
Revert "[utils] Add support for cookies with spaces used instead of tabs"
According to [1] TABs must be used as separators between fields. Files produces by some tools with spaces as separators are considered malformed. 1. https://curl.haxx.se/docs/http-cookies.html This reverts commit cff99c91d150df2a4e21962a3ca8d4ae94533b8c.
Diffstat (limited to 'test/test_YoutubeDLCookieJar.py')
-rw-r--r--test/test_YoutubeDLCookieJar.py14
1 files changed, 5 insertions, 9 deletions
diff --git a/test/test_YoutubeDLCookieJar.py b/test/test_YoutubeDLCookieJar.py
index f833efac5..f959798de 100644
--- a/test/test_YoutubeDLCookieJar.py
+++ b/test/test_YoutubeDLCookieJar.py
@@ -14,9 +14,6 @@ from youtube_dl.utils import YoutubeDLCookieJar
class TestYoutubeDLCookieJar(unittest.TestCase):
- def __assert_cookie_has_value(self, cookiejar, key):
- self.assertEqual(cookiejar._cookies['www.foobar.foobar']['/'][key].value, key + '_VALUE')
-
def test_keep_session_cookies(self):
cookiejar = YoutubeDLCookieJar('./test/testdata/cookies/session_cookies.txt')
cookiejar.load(ignore_discard=True, ignore_expires=True)
@@ -35,13 +32,12 @@ class TestYoutubeDLCookieJar(unittest.TestCase):
def test_strip_httponly_prefix(self):
cookiejar = YoutubeDLCookieJar('./test/testdata/cookies/httponly_cookies.txt')
cookiejar.load(ignore_discard=True, ignore_expires=True)
- self.__assert_cookie_has_value(cookiejar, 'HTTPONLY_COOKIE')
- self.__assert_cookie_has_value(cookiejar, 'JS_ACCESSIBLE_COOKIE')
- def test_convert_spaces_to_tabs(self):
- cookiejar = YoutubeDLCookieJar('./test/testdata/cookies/cookie_file_with_spaces.txt')
- cookiejar.load(ignore_discard=True, ignore_expires=True)
- self.__assert_cookie_has_value(cookiejar, 'COOKIE')
+ 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__':