diff options
author | codl <[email protected]> | 2017-11-27 18:44:15 +0100 |
---|---|---|
committer | codl <[email protected]> | 2017-11-27 18:44:15 +0100 |
commit | 29b73a57b8a3ab7df7d71d75634be582e542a803 (patch) | |
tree | 845d4d74901f1e2b3390a713bd37c69cb1794990 /tests | |
parent | e8d10795621730ffdab5be67c913d68e5d9abe07 (diff) | |
download | mastodon.py-29b73a57b8a3ab7df7d71d75634be582e542a803.tar.gz |
add test for auth_request_url
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_auth.py | 16 |
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 @@ | |||
1 | try: | ||
2 | from urllib.parse import urlparse, parse_qs | ||
3 | except ImportError: | ||
4 | from urlparse import urlparse, parse_qs | ||
5 | |||
6 | def 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 | |||