From 29b73a57b8a3ab7df7d71d75634be582e542a803 Mon Sep 17 00:00:00 2001 From: codl Date: Mon, 27 Nov 2017 18:44:15 +0100 Subject: [PATCH] add test for auth_request_url --- tests/test_auth.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 tests/test_auth.py 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 @@ +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')) + +