Skip to content

Commit

Permalink
Merge edbba81 into f080fbc
Browse files Browse the repository at this point in the history
  • Loading branch information
LilSpazJoekp committed Jul 3, 2020
2 parents f080fbc + edbba81 commit beb0a27
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion asyncprawcore/auth.py
Expand Up @@ -80,7 +80,7 @@ def authorize_url(self, duration, scopes, state, implicit=False):
}
url = self._requestor.reddit_url + const.AUTHORIZATION_PATH
request = ClientRequest("GET", URL(url), params=params)
return request.url
return str(request.url)

async def revoke_token(self, token, token_type=None):
"""Ask Reddit to revoke the provided token.
Expand Down
30 changes: 15 additions & 15 deletions tests/test_authenticator.py
Expand Up @@ -20,11 +20,11 @@ async def test_authorize_url(self):
url = authenticator.authorize_url(
"permanent", ["identity", "read"], "a_state"
)
self.assertIn(f"client_id={CLIENT_ID}", str(url))
self.assertIn("duration=permanent", str(url))
self.assertIn("response_type=code", str(url))
self.assertIn("scope=identity+read", str(url))
self.assertIn("state=a_state", str(url))
self.assertIn(f"client_id={CLIENT_ID}", url)
self.assertIn("duration=permanent", url)
self.assertIn("response_type=code", url)
self.assertIn("scope=identity+read", url)
self.assertIn("state=a_state", url)

def test_authorize_url__fail_with_implicit(self):
authenticator = asyncprawcore.TrustedAuthenticator(
Expand Down Expand Up @@ -91,11 +91,11 @@ async def test_authorize_url__code(self):
url = authenticator.authorize_url(
"permanent", ["identity", "read"], "a_state"
)
self.assertIn(f"client_id={CLIENT_ID}", str(url))
self.assertIn("duration=permanent", str(url))
self.assertIn("response_type=code", str(url))
self.assertIn("scope=identity+read", str(url))
self.assertIn("state=a_state", str(url))
self.assertIn(f"client_id={CLIENT_ID}", url)
self.assertIn("duration=permanent", url)
self.assertIn("response_type=code", url)
self.assertIn("scope=identity+read", url)
self.assertIn("state=a_state", url)

async def test_authorize_url__token(self):
authenticator = asyncprawcore.UntrustedAuthenticator(
Expand All @@ -104,11 +104,11 @@ async def test_authorize_url__token(self):
url = authenticator.authorize_url(
"temporary", ["identity", "read"], "a_state", implicit=True
)
self.assertIn(f"client_id={CLIENT_ID}", str(url))
self.assertIn("duration=temporary", str(url))
self.assertIn("response_type=token", str(url))
self.assertIn("scope=identity+read", str(url))
self.assertIn("state=a_state", str(url))
self.assertIn(f"client_id={CLIENT_ID}", url)
self.assertIn("duration=temporary", url)
self.assertIn("response_type=token", url)
self.assertIn("scope=identity+read", url)
self.assertIn("state=a_state", url)

async def test_authorize_url__fail_with_token_and_permanent(self):
authenticator = asyncprawcore.UntrustedAuthenticator(
Expand Down

0 comments on commit beb0a27

Please sign in to comment.