0
0
mirror of https://github.com/ihabunek/toot.git synced 2025-10-21 19:44:16 -04:00

Standardize http request method parameters

This allows setting either json or data. Until now we were always using
data and this is not enough for some endpoints.
This commit is contained in:
Ivan Habunek
2022-11-22 09:51:09 +01:00
parent 8c3baa704e
commit b15cb85a23
5 changed files with 40 additions and 33 deletions

View File

@@ -17,7 +17,7 @@ def test_create_app(mock_post):
create_app('bigfish.software')
mock_post.assert_called_once_with('https://bigfish.software/api/v1/apps', {
mock_post.assert_called_once_with('https://bigfish.software/api/v1/apps', json={
'website': CLIENT_WEBSITE,
'client_name': CLIENT_NAME,
'scopes': SCOPES,
@@ -48,7 +48,7 @@ def test_login(mock_post):
login(app, 'user', 'pass')
mock_post.assert_called_once_with(
'https://bigfish.software/oauth/token', data, allow_redirects=False)
'https://bigfish.software/oauth/token', data=data, allow_redirects=False)
@mock.patch('toot.http.anon_post')
@@ -70,4 +70,4 @@ def test_login_failed(mock_post):
login(app, 'user', 'pass')
mock_post.assert_called_once_with(
'https://bigfish.software/oauth/token', data, allow_redirects=False)
'https://bigfish.software/oauth/token', data=data, allow_redirects=False)