1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
|
"""Test for subclasses of asyncprawcore.auth.BaseAuthenticator class."""
import pytest
import asyncprawcore
from . import IntegrationTest
class TestTrustedAuthenticator(IntegrationTest):
async def test_revoke_token(self, requestor):
authenticator = asyncprawcore.TrustedAuthenticator(
requestor,
pytest.placeholders.client_id,
pytest.placeholders.client_secret,
)
await authenticator.revoke_token("dummy token")
async def test_revoke_token__with_access_token_hint(self, requestor):
authenticator = asyncprawcore.TrustedAuthenticator(
requestor,
pytest.placeholders.client_id,
pytest.placeholders.client_secret,
)
await authenticator.revoke_token("dummy token", "access_token")
async def test_revoke_token__with_refresh_token_hint(self, requestor):
authenticator = asyncprawcore.TrustedAuthenticator(
requestor,
pytest.placeholders.client_id,
pytest.placeholders.client_secret,
)
await authenticator.revoke_token("dummy token", "refresh_token")
class TestUntrustedAuthenticator(IntegrationTest):
async def test_revoke_token(self, requestor):
authenticator = asyncprawcore.UntrustedAuthenticator(requestor, pytest.placeholders.client_id)
await authenticator.revoke_token("dummy token")
|