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

skip OAuth tests when server is unreachable

This commit is contained in:
Mike Fährmann 2020-05-10 00:33:00 +02:00
parent f557cac074
commit 4b606b68e4
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

View File

@ -14,6 +14,7 @@ import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from gallery_dl import oauth, text # noqa E402
TESTSERVER = "http://term.ie/oauth/example"
TESTSERVER = "http://term.ie/oauth/example"
CONSUMER_KEY = "key"
CONSUMER_SECRET = "secret"
@ -99,8 +100,10 @@ class TestOAuthSession(unittest.TestCase):
CONSUMER_KEY, CONSUMER_SECRET,
oauth_token, oauth_token_secret,
)
url = TESTSERVER + endpoint
return session.get(url, params=params).text
try:
return session.get(TESTSERVER + endpoint, params=params).text
except OSError:
raise unittest.SkipTest()
if __name__ == "__main__":