ensure keys for mastodon instances are available during tests

Calls to config.clear() from other tests are removing the API
credentials set when importing mastodon.py for the first time.
This commit is contained in:
Mike Fährmann
2020-04-08 21:56:14 +02:00
parent 300264f676
commit 406449b0d6

View File

@@ -16,6 +16,7 @@ import unittest
from unittest.mock import patch
from gallery_dl import extractor
from gallery_dl.extractor import mastodon
from gallery_dl.extractor.common import Extractor, Message
from gallery_dl.extractor.directlink import DirectlinkExtractor as DLExtractor
@@ -236,6 +237,10 @@ class TestExtractorWait(unittest.TestCase):
class TextExtractorOAuth(unittest.TestCase):
@classmethod
def setUpClass(cls):
mastodon.generate_extractors()
def test_oauth1(self):
for category in ("flickr", "smugmug", "tumblr"):
extr = extractor.find("oauth:" + category)