aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcodl <[email protected]>2017-11-27 18:44:15 +0100
committercodl <[email protected]>2017-11-27 18:44:15 +0100
commit29b73a57b8a3ab7df7d71d75634be582e542a803 (patch)
tree845d4d74901f1e2b3390a713bd37c69cb1794990
parente8d10795621730ffdab5be67c913d68e5d9abe07 (diff)
downloadmastodon.py-29b73a57b8a3ab7df7d71d75634be582e542a803.tar.gz
add test for auth_request_url
-rw-r--r--tests/test_auth.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/test_auth.py b/tests/test_auth.py
new file mode 100644
index 0000000..3b62a2f
--- /dev/null
+++ b/tests/test_auth.py
@@ -0,0 +1,16 @@
1try:
2 from urllib.parse import urlparse, parse_qs
3except ImportError:
4 from urlparse import urlparse, parse_qs
5
6def test_auth_request_url(api):
7 url = api.auth_request_url()
8 parse = urlparse(url)
9 assert parse.path == '/oauth/authorize'
10 query = parse_qs(parse.query)
11 assert query['client_id'][0] == api.client_id
12 assert query['response_type'][0] == 'code'
13 assert query['redirect_uri'][0] == 'urn:ietf:wg:oauth:2.0:oob'
14 assert set(query['scope'][0].split()) == set(('read', 'write', 'follow'))
15
16
Powered by cgit v1.2.3 (git 2.41.0)