add test for auth_request_url

This commit is contained in:
codl 2017-11-27 18:44:15 +01:00
pare e8d1079562
commit 29b73a57b8
No se encontró ninguna clave conocida en la base de datos para esta firma
ID de clave GPG: 6CD7C8891ED1233A

16
tests/test_auth.py Normal file
Veure arxiu

@ -0,0 +1,16 @@
try:
from urllib.parse import urlparse, parse_qs
except ImportError:
from urlparse import urlparse, parse_qs
def test_auth_request_url(api):
url = api.auth_request_url()
parse = urlparse(url)
assert parse.path == '/oauth/authorize'
query = parse_qs(parse.query)
assert query['client_id'][0] == api.client_id
assert query['response_type'][0] == 'code'
assert query['redirect_uri'][0] == 'urn:ietf:wg:oauth:2.0:oob'
assert set(query['scope'][0].split()) == set(('read', 'write', 'follow'))