update test_cookies.py
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Copyright 2017-2019 Mike Fährmann
|
# Copyright 2017-2020 Mike Fährmann
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software; you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License version 2 as
|
# it under the terms of the GNU General Public License version 2 as
|
||||||
@@ -12,7 +12,6 @@ from unittest import mock
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
import tempfile
|
import tempfile
|
||||||
import http.cookiejar
|
|
||||||
from os.path import join
|
from os.path import join
|
||||||
|
|
||||||
import gallery_dl.config as config
|
import gallery_dl.config as config
|
||||||
@@ -34,7 +33,7 @@ class TestCookiejar(unittest.TestCase):
|
|||||||
cls.invalid_cookiefile = join(cls.path.name, "invalid.txt")
|
cls.invalid_cookiefile = join(cls.path.name, "invalid.txt")
|
||||||
with open(cls.invalid_cookiefile, "w") as file:
|
with open(cls.invalid_cookiefile, "w") as file:
|
||||||
file.write("""# asd
|
file.write("""# asd
|
||||||
.example.org\tTRUE\t/\tFALSE\t253402210800\tNAME\tVALUE
|
.example.org\tTRUE/FALSE\t253402210800\tNAME\tVALUE
|
||||||
""")
|
""")
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@@ -55,7 +54,7 @@ class TestCookiejar(unittest.TestCase):
|
|||||||
self.assertEqual(cookie.value , "VALUE")
|
self.assertEqual(cookie.value , "VALUE")
|
||||||
|
|
||||||
def test_invalid_cookiefile(self):
|
def test_invalid_cookiefile(self):
|
||||||
self._test_warning(self.invalid_cookiefile, http.cookiejar.LoadError)
|
self._test_warning(self.invalid_cookiefile, ValueError)
|
||||||
|
|
||||||
def test_invalid_filename(self):
|
def test_invalid_filename(self):
|
||||||
self._test_warning(join(self.path.name, "nothing"), FileNotFoundError)
|
self._test_warning(join(self.path.name, "nothing"), FileNotFoundError)
|
||||||
|
|||||||
Reference in New Issue
Block a user