fix cookie tests
update _get_extractor(): - always return an Extractor instance with a _login_impl() method - use Extractor.from_url()
This commit is contained in:
@@ -17,7 +17,6 @@ from os.path import join
|
|||||||
|
|
||||||
import gallery_dl.config as config
|
import gallery_dl.config as config
|
||||||
import gallery_dl.extractor as extractor
|
import gallery_dl.extractor as extractor
|
||||||
from gallery_dl.extractor.message import Message
|
|
||||||
|
|
||||||
CKEY = ("cookies",)
|
CKEY = ("cookies",)
|
||||||
|
|
||||||
@@ -121,9 +120,10 @@ class TestCookieLogin(unittest.TestCase):
|
|||||||
|
|
||||||
|
|
||||||
def _get_extractor(category):
|
def _get_extractor(category):
|
||||||
for msg in extractor.find("test:" + category):
|
for extr in extractor.extractors():
|
||||||
if msg[0] == Message.Queue:
|
if extr.category == category and hasattr(extr, "_login_impl"):
|
||||||
return extractor.find(msg[1])
|
url = next(extr._get_tests())[0]
|
||||||
|
return extr.from_url(url)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|||||||
Reference in New Issue
Block a user