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:
parent
f557cac074
commit
4b606b68e4
@ -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__":
|
||||
|
Loading…
Reference in New Issue
Block a user