aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/test_YoutubeDLCookieJar.py14
-rw-r--r--test/testdata/cookies/cookie_file_with_spaces.txt5
2 files changed, 5 insertions, 14 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__':
diff --git a/test/testdata/cookies/cookie_file_with_spaces.txt b/test/testdata/cookies/cookie_file_with_spaces.txt
deleted file mode 100644
index 6fda35fa0..000000000
--- a/test/testdata/cookies/cookie_file_with_spaces.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-# Netscape HTTP Cookie File
-# http://curl.haxx.se/rfc/cookie_spec.html
-# This is a generated file! Do not edit.
-
-www.foobar.foobar FALSE / TRUE 2147483647 COOKIE COOKIE_VALUE