Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,6 @@

Python library for authorizing access and fetching personal data from portability APIs and services

## Using `pardner`

### With classes

In `services/` you'll find classes defined for different services that are supported by the library (e.g., Tumblr). You can make an instance of that class and use that same object for getting initial authorization from a user and for making data transfer requests.

### Stateless mode

In `stateless/` there are modules that expose functions grouped by service that allow you to complete the same tasks as in the classes described above. Unlike using pardner with the classes we provide, however, you supply the necessary data each time you make a request for each request.

## Developer set-up

> **tl;dr**:
Expand Down
1 change: 0 additions & 1 deletion src/pardner/stateless/__init__.py

This file was deleted.

71 changes: 0 additions & 71 deletions src/pardner/stateless/base.py

This file was deleted.

35 changes: 0 additions & 35 deletions src/pardner/stateless/utils.py

This file was deleted.

Empty file removed tests/__init__.py
Empty file.
18 changes: 0 additions & 18 deletions tests/conftest.py

This file was deleted.

Empty file removed tests/test_stateless/__init__.py
Empty file.
74 changes: 0 additions & 74 deletions tests/test_stateless/test_base.py

This file was deleted.

33 changes: 0 additions & 33 deletions tests/test_stateless/test_utils.py

This file was deleted.

Empty file.
13 changes: 8 additions & 5 deletions tests/test_transfer_services/test_tumblr.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
from urllib import parse

import pytest

from pardner.services import TumblrTransferService
from pardner.verticals import Vertical
from tests.conftest import get_url_params

sample_scope = {'fake', 'scope'}

Expand All @@ -24,7 +25,8 @@ def test_scope_for_vertical(mock_tumblr_transfer_service, verticals, expected_sc
def test_authorization_url(mock_tumblr_transfer_service):
auth_url, state = mock_tumblr_transfer_service.authorization_url()

auth_url_params = get_url_params(auth_url)
auth_url_query = parse.urlsplit(auth_url).query
auth_url_params = dict(parse.parse_qsl(auth_url_query))

assert 'client_id' in auth_url_params
assert auth_url_params['client_id'] == 'fake_client_id'
Expand All @@ -39,9 +41,10 @@ def test_fetch_token_raises_error(mock_tumblr_transfer_service):
mock_tumblr_transfer_service.fetch_token()


def test_fetch_token(mock_tumblr_transfer_service, mock_outbound_requests):
mock_oauth2session_request, mock_client_parse_request_body_response = (
mock_outbound_requests
def test_fetch_token(mocker, mock_tumblr_transfer_service):
mock_oauth2session_request = mocker.patch('requests_oauthlib.OAuth2Session.request')
mock_client_parse_request_body_response = mocker.patch(
'oauthlib.oauth2.rfc6749.clients.WebApplicationClient.parse_request_body_response'
)
mock_tumblr_transfer_service.fetch_token(code='123code123')
mock_oauth2session_request.assert_called_once()
Expand Down