1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-25 12:12:34 +01:00

update test_cookies.py

This commit is contained in:
Mike Fährmann 2020-01-21 22:46:58 +01:00
parent c1a6862863
commit b3b5754f2d
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

View File

@ -1,7 +1,7 @@
#!/usr/bin/env python3
# -*- 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
# it under the terms of the GNU General Public License version 2 as
@ -12,7 +12,6 @@ from unittest import mock
import logging
import tempfile
import http.cookiejar
from os.path import join
import gallery_dl.config as config
@ -34,7 +33,7 @@ class TestCookiejar(unittest.TestCase):
cls.invalid_cookiefile = join(cls.path.name, "invalid.txt")
with open(cls.invalid_cookiefile, "w") as file:
file.write("""# asd
.example.org\tTRUE\t/\tFALSE\t253402210800\tNAME\tVALUE
.example.org\tTRUE/FALSE\t253402210800\tNAME\tVALUE
""")
@classmethod
@ -55,7 +54,7 @@ class TestCookiejar(unittest.TestCase):
self.assertEqual(cookie.value , "VALUE")
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):
self._test_warning(join(self.path.name, "nothing"), FileNotFoundError)