add test for auth_request_url
This commit is contained in:
pare
e8d1079562
commit
29b73a57b8
S'han modificat 1 arxius amb 16 adicions i 0 eliminacions
16
tests/test_auth.py
Normal file
16
tests/test_auth.py
Normal file
|
@ -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'))
|
||||||
|
|
||||||
|
|
Loading…
Referencia en una nova incidència