25 lines
643 B
Python
25 lines
643 B
Python
from mastodon.application import MastodonApplication
|
|
import pytest
|
|
import responses
|
|
|
|
|
|
@pytest.fixture
|
|
def app():
|
|
yield MastodonApplication("pymastodon")
|
|
|
|
@responses.activate
|
|
def test_authorize(app):
|
|
# responses.add(responses.GET, 'http://twitter.com/api/1/foobar',
|
|
# json={'error': 'not found'}, status=404)
|
|
responses.post(
|
|
"http://social.example.com/oauth/token",
|
|
json={"type": "post"},
|
|
)
|
|
app.authorization.authorize()
|
|
token = app.authorization.fetch_token()
|
|
assert token is not None
|
|
|
|
def test_get_login_url(app):
|
|
url = app.authorization.get_login_url()
|
|
assert url is not None
|