Comparar commits
38 commits
Autor | SHA1 | Fecha | |
---|---|---|---|
spla | 75d5a5cba4 | ||
spla | b53ab9d358 | ||
spla | 05744034b8 | ||
spla | 220c2a7069 | ||
spla | f29760549f | ||
spla | a24b310c5b | ||
spla | e33166f025 | ||
spla | f49203f9a4 | ||
spla | 11d9da9291 | ||
89a6bd2bac | |||
1d1a08b51a | |||
7f234664f7 | |||
61e1a8e450 | |||
f722778095 | |||
bd04a0f886 | |||
2dce8a297a | |||
7fd2a6a39c | |||
f8f988710c | |||
cab72d0489 | |||
98615146a6 | |||
c7fdcf3fae | |||
a987af8a0d | |||
b225524d7c | |||
af59a46068 | |||
c9008a1cdc | |||
e98b033646 | |||
7e0460ddcb | |||
002c6511a7 | |||
243d7a2c55 | |||
3b8a653fa5 | |||
2c06de91dd | |||
19dbb4594e | |||
0f92f778dc | |||
539edfa8ee | |||
e9d2c3d53f | |||
28b6cc6c06 | |||
346e6e8478 | |||
a793c25506 |
57
README.md
Normal file
57
README.md
Normal file
|
@ -0,0 +1,57 @@
|
||||||
|
# Mastodonplus.py
|
||||||
|
Fork of Python wrapper for the Mastodon (https://github.com/mastodon/mastodon) API.
|
||||||
|
The goal of this fork is to add all 'new' Mastodon API's endpoints to the excellent [halcy's wrapper](https://github.com/halcy/Mastodon.py).
|
||||||
|
|
||||||
|
#### Register your app! This only needs to be done once. Uncomment the code and substitute in your information.
|
||||||
|
|
||||||
|
```
|
||||||
|
from mastodon import Mastodon
|
||||||
|
|
||||||
|
Mastodon.create_app(
|
||||||
|
'pytooterapp',
|
||||||
|
api_base_url = 'https://your-mastodon.server'
|
||||||
|
to_file = 'pytooter_clientcred.secret'
|
||||||
|
)
|
||||||
|
```
|
||||||
|
#### Then login. This can be done every time, or use persisted.
|
||||||
|
|
||||||
|
```
|
||||||
|
from mastodon import Mastodon
|
||||||
|
|
||||||
|
mastodon = Mastodon(
|
||||||
|
client_id = 'pytooter_clientcred.secret',
|
||||||
|
api_base_url = 'https://your-mastodon.server'
|
||||||
|
)
|
||||||
|
mastodon.log_in(
|
||||||
|
'my_login_email@example.com',
|
||||||
|
'incrediblygoodpassword',
|
||||||
|
to_file = 'pytooter_usercred.secret'
|
||||||
|
)
|
||||||
|
```
|
||||||
|
#### To post, create an actual API instance.
|
||||||
|
|
||||||
|
```
|
||||||
|
from mastodon import Mastodon
|
||||||
|
|
||||||
|
mastodon = Mastodon(
|
||||||
|
access_token = 'pytooter_usercred.secret',
|
||||||
|
api_base_url = 'https://your-mastodon.server>'
|
||||||
|
)
|
||||||
|
mastodon.toot('Tooting from python using #mastodonpy !')
|
||||||
|
```
|
||||||
|
You can install Mastodonplus.py via pypi:
|
||||||
|
|
||||||
|
```
|
||||||
|
# Python 3
|
||||||
|
pip3 install Mastodonplus.py
|
||||||
|
```
|
||||||
|
#### New features
|
||||||
|
|
||||||
|
* 26.8.2022. Mastodon v3.6.0. Added New endpoints: /api/v1/admin/domain_blocks (list,show by id, delete and create)
|
||||||
|
* 27.8.2022. Mastodon v3.1.4. Added 'remote" param to GET /api/v1/timelines/public REST API
|
||||||
|
* 27.8.2022. Mastodon v3.1.4. Added GET /api/v1/streaming/public/remote (Mastodon.stream_remote())
|
||||||
|
* 06.9.2022. Mastodon v3.2.0. Added POST /api/v1/accounts/:account_id/note with comment param. (Mastodon.accounts_note(id=account_id, comment='comment')
|
||||||
|
* 06.9.2022. Mastodon v3.6.0. Added GET /api/v1/admin/ip_blocks (Mastodon.admin_ip_blocks_list(max_id=None, min_id=None, since_id=None, limit=None)
|
||||||
|
* 06.9.2022. Mastodon v3.6.0. Added DELETE /api/v1/admin/ip_blocks/:id (Mastodon.admin_ip_blocks_delete(id=None)
|
||||||
|
* 06.9.2022. Mastodon v3.6.0. Added POST /api/v1/admin/ip_blocks (Mastodon.admin_ip_blocks_create(self, ip=None, severity=None, comment=None, expires_in=None)
|
||||||
|
severity possible values are: sign_up_requires_approval, sign_up_block, no_access
|
67
README.rst
67
README.rst
|
@ -1,67 +0,0 @@
|
||||||
Mastodon.py
|
|
||||||
===========
|
|
||||||
Python wrapper for the Mastodon ( https://github.com/tootsuite/mastodon/ ) API.
|
|
||||||
Feature complete for public API as of Mastodon version 3.0.1 and easy to get started with:
|
|
||||||
|
|
||||||
.. code-block:: python
|
|
||||||
|
|
||||||
# Register your app! This only needs to be done once. Uncomment the code and substitute in your information.
|
|
||||||
|
|
||||||
from mastodon import Mastodon
|
|
||||||
|
|
||||||
'''
|
|
||||||
Mastodon.create_app(
|
|
||||||
'pytooterapp',
|
|
||||||
api_base_url = 'https://mastodon.social',
|
|
||||||
to_file = 'pytooter_clientcred.secret'
|
|
||||||
)
|
|
||||||
'''
|
|
||||||
|
|
||||||
# Then login. This can be done every time, or use persisted.
|
|
||||||
|
|
||||||
from mastodon import Mastodon
|
|
||||||
|
|
||||||
mastodon = Mastodon(
|
|
||||||
client_id = 'pytooter_clientcred.secret',
|
|
||||||
api_base_url = 'https://mastodon.social'
|
|
||||||
)
|
|
||||||
mastodon.log_in(
|
|
||||||
'my_login_email@example.com',
|
|
||||||
'incrediblygoodpassword',
|
|
||||||
to_file = 'pytooter_usercred.secret'
|
|
||||||
)
|
|
||||||
|
|
||||||
# To post, create an actual API instance.
|
|
||||||
|
|
||||||
from mastodon import Mastodon
|
|
||||||
|
|
||||||
mastodon = Mastodon(
|
|
||||||
access_token = 'pytooter_usercred.secret',
|
|
||||||
api_base_url = 'https://mastodon.social'
|
|
||||||
)
|
|
||||||
mastodon.toot('Tooting from python using #mastodonpy !')
|
|
||||||
|
|
||||||
You can install Mastodon.py via pypi:
|
|
||||||
|
|
||||||
.. code-block:: Bash
|
|
||||||
|
|
||||||
# Python 3
|
|
||||||
pip3 install Mastodon.py
|
|
||||||
|
|
||||||
Note that python 2.7 is now no longer officially supported. It will still
|
|
||||||
work for a while, and we will fix issues as they come up, but we will not
|
|
||||||
be testing specifically for python 2.7 any longer.
|
|
||||||
|
|
||||||
Full documentation and basic usage examples can be found
|
|
||||||
at http://mastodonpy.readthedocs.io/en/stable/ .
|
|
||||||
|
|
||||||
Acknowledgements
|
|
||||||
----------------
|
|
||||||
Mastodon.py contains work by a large amount of contributors, many of which have
|
|
||||||
put significant work into making it a better library. You can find some information
|
|
||||||
about who helped with which particular feature or fix in the changelog.
|
|
||||||
|
|
||||||
.. image:: https://travis-ci.org/halcy/Mastodon.py.svg?branch=master
|
|
||||||
:target: https://travis-ci.org/halcy/Mastodon.py
|
|
||||||
.. image:: https://codecov.io/gh/halcy/Mastodon.py/branch/master/graph/badge.svg
|
|
||||||
:target: https://codecov.io/gh/halcy/Mastodon.py
|
|
|
@ -1275,6 +1275,19 @@ The streaming functions take instances of `StreamListener` as the `listener` par
|
||||||
A `CallbackStreamListener` class that allows you to specify function callbacks
|
A `CallbackStreamListener` class that allows you to specify function callbacks
|
||||||
directly is included for convenience.
|
directly is included for convenience.
|
||||||
|
|
||||||
|
For new well-known events implement the streaming function in `StreamListener` or `CallbackStreamListener`.
|
||||||
|
The function name is `on_` + the event name. If the event-name contains dots, use an underscore instead.
|
||||||
|
|
||||||
|
E.g. for `'status.update'` the listener function should be named as `on_status_update`.
|
||||||
|
|
||||||
|
It may be that future Mastodon versions will come with completely new (unknown) event names. In this
|
||||||
|
case a (deprecated) Mastodon.py would throw an error. If you want to avoid this in general, you can
|
||||||
|
override the listener function `on_unknown_event`. This has an additional parameter `name` which informs
|
||||||
|
about the name of the event. `unknown_event` contains the content of the event.
|
||||||
|
|
||||||
|
Alternatively, a callback function can be passed in the `unknown_event_handler` parameter in the
|
||||||
|
`CallbackStreamListener` constructor.
|
||||||
|
|
||||||
When in not-async mode or async mode without async_reconnect, the stream functions may raise
|
When in not-async mode or async mode without async_reconnect, the stream functions may raise
|
||||||
various exceptions: `MastodonMalformedEventError` if a received event cannot be parsed and
|
various exceptions: `MastodonMalformedEventError` if a received event cannot be parsed and
|
||||||
`MastodonNetworkError` if any connection problems occur.
|
`MastodonNetworkError` if any connection problems occur.
|
||||||
|
@ -1294,6 +1307,7 @@ StreamListener
|
||||||
.. automethod:: StreamListener.on_notification
|
.. automethod:: StreamListener.on_notification
|
||||||
.. automethod:: StreamListener.on_delete
|
.. automethod:: StreamListener.on_delete
|
||||||
.. automethod:: StreamListener.on_conversation
|
.. automethod:: StreamListener.on_conversation
|
||||||
|
.. automethod:: StreamListener.on_unknown_event
|
||||||
.. automethod:: StreamListener.on_abort
|
.. automethod:: StreamListener.on_abort
|
||||||
.. automethod:: StreamListener.handle_heartbeat
|
.. automethod:: StreamListener.handle_heartbeat
|
||||||
|
|
||||||
|
|
|
@ -120,10 +120,27 @@ class AttribAccessDict(dict):
|
||||||
raise AttributeError("Attribute-style access is read only")
|
raise AttributeError("Attribute-style access is read only")
|
||||||
super(AttribAccessDict, self).__setattr__(attr, val)
|
super(AttribAccessDict, self).__setattr__(attr, val)
|
||||||
|
|
||||||
|
|
||||||
|
###
|
||||||
|
# List helper class.
|
||||||
|
# Defined at top level so it can be pickled.
|
||||||
|
###
|
||||||
|
class AttribAccessList(list):
|
||||||
|
def __getattr__(self, attr):
|
||||||
|
if attr in self:
|
||||||
|
return self[attr]
|
||||||
|
else:
|
||||||
|
raise AttributeError("Attribute not found: " + str(attr))
|
||||||
|
|
||||||
|
def __setattr__(self, attr, val):
|
||||||
|
if attr in self:
|
||||||
|
raise AttributeError("Attribute-style access is read only")
|
||||||
|
super(AttribAccessList, self).__setattr__(attr, val)
|
||||||
|
|
||||||
|
|
||||||
###
|
###
|
||||||
# The actual Mastodon class
|
# The actual Mastodon class
|
||||||
###
|
###
|
||||||
|
|
||||||
class Mastodon:
|
class Mastodon:
|
||||||
"""
|
"""
|
||||||
Thorough and easy to use Mastodon
|
Thorough and easy to use Mastodon
|
||||||
|
@ -176,10 +193,14 @@ class Mastodon:
|
||||||
'admin:read': [
|
'admin:read': [
|
||||||
'admin:read:accounts',
|
'admin:read:accounts',
|
||||||
'admin:read:reports',
|
'admin:read:reports',
|
||||||
|
'admin:read:domain_blocks',
|
||||||
|
'admin:read:ip_blocks',
|
||||||
],
|
],
|
||||||
'admin:write': [
|
'admin:write': [
|
||||||
'admin:write:accounts',
|
'admin:write:accounts',
|
||||||
'admin:write:reports',
|
'admin:write:reports',
|
||||||
|
'admin:write:domain_blocks',
|
||||||
|
'admin:write:ip_blocks',
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
__VALID_SCOPES = ['read', 'write', 'follow', 'push', 'admin:read', 'admin:write'] + \
|
__VALID_SCOPES = ['read', 'write', 'follow', 'push', 'admin:read', 'admin:write'] + \
|
||||||
|
@ -218,6 +239,8 @@ class Mastodon:
|
||||||
__DICT_VERSION_MARKER = "3.0.0"
|
__DICT_VERSION_MARKER = "3.0.0"
|
||||||
__DICT_VERSION_REACTION = "3.1.0"
|
__DICT_VERSION_REACTION = "3.1.0"
|
||||||
__DICT_VERSION_ANNOUNCEMENT = bigger_version("3.1.0", __DICT_VERSION_REACTION)
|
__DICT_VERSION_ANNOUNCEMENT = bigger_version("3.1.0", __DICT_VERSION_REACTION)
|
||||||
|
__DICT_VERSION_DOMAIN_BLOCKS = "3.6.0"
|
||||||
|
__DICT_VERSION_IP_BLOCKS = "3.6.0"
|
||||||
|
|
||||||
###
|
###
|
||||||
# Registering apps
|
# Registering apps
|
||||||
|
@ -276,6 +299,7 @@ class Mastodon:
|
||||||
secret_file.write(response['client_id'] + "\n")
|
secret_file.write(response['client_id'] + "\n")
|
||||||
secret_file.write(response['client_secret'] + "\n")
|
secret_file.write(response['client_secret'] + "\n")
|
||||||
secret_file.write(api_base_url + "\n")
|
secret_file.write(api_base_url + "\n")
|
||||||
|
secret_file.write(client_name + "\n")
|
||||||
|
|
||||||
return (response['client_id'], response['client_secret'])
|
return (response['client_id'], response['client_secret'])
|
||||||
|
|
||||||
|
@ -286,7 +310,7 @@ class Mastodon:
|
||||||
api_base_url=None, debug_requests=False,
|
api_base_url=None, debug_requests=False,
|
||||||
ratelimit_method="wait", ratelimit_pacefactor=1.1,
|
ratelimit_method="wait", ratelimit_pacefactor=1.1,
|
||||||
request_timeout=__DEFAULT_TIMEOUT, mastodon_version=None,
|
request_timeout=__DEFAULT_TIMEOUT, mastodon_version=None,
|
||||||
version_check_mode = "created", session=None, feature_set="mainline"):
|
version_check_mode = "created", session=None, feature_set="mainline", user_agent=None):
|
||||||
"""
|
"""
|
||||||
Create a new API wrapper instance based on the given `client_secret` and `client_id`. If you
|
Create a new API wrapper instance based on the given `client_secret` and `client_id`. If you
|
||||||
give a `client_id` and it is not a file, you must also give a secret. If you specify an
|
give a `client_id` and it is not a file, you must also give a secret. If you specify an
|
||||||
|
@ -331,6 +355,11 @@ class Mastodon:
|
||||||
`feature_set` can be used to enable behaviour specific to non-mainline Mastodon API implementations.
|
`feature_set` can be used to enable behaviour specific to non-mainline Mastodon API implementations.
|
||||||
Details are documented in the functions that provide such functionality. Currently supported feature
|
Details are documented in the functions that provide such functionality. Currently supported feature
|
||||||
sets are `mainline`, `fedibird` and `pleroma`.
|
sets are `mainline`, `fedibird` and `pleroma`.
|
||||||
|
|
||||||
|
For some mastodon-instances a `User-Agent` header is needed. This can be set by parameter `user_agent`. From now
|
||||||
|
`create_app()` stores the application name into the client secret file. If `client_id` points to this file,
|
||||||
|
the app name will be used as `User-Agent` header as default. It's possible to modify old secret files and append
|
||||||
|
a client app name to use it as a `User-Agent` name.
|
||||||
"""
|
"""
|
||||||
self.api_base_url = None
|
self.api_base_url = None
|
||||||
if not api_base_url is None:
|
if not api_base_url is None:
|
||||||
|
@ -362,6 +391,9 @@ class Mastodon:
|
||||||
self.feature_set = feature_set
|
self.feature_set = feature_set
|
||||||
if not self.feature_set in ["mainline", "fedibird", "pleroma"]:
|
if not self.feature_set in ["mainline", "fedibird", "pleroma"]:
|
||||||
raise MastodonIllegalArgumentError('Requested invalid feature set')
|
raise MastodonIllegalArgumentError('Requested invalid feature set')
|
||||||
|
|
||||||
|
# General defined user-agent
|
||||||
|
self.user_agent = user_agent
|
||||||
|
|
||||||
# Token loading
|
# Token loading
|
||||||
if self.client_id is not None:
|
if self.client_id is not None:
|
||||||
|
@ -376,6 +408,11 @@ class Mastodon:
|
||||||
if not (self.api_base_url is None or try_base_url == self.api_base_url):
|
if not (self.api_base_url is None or try_base_url == self.api_base_url):
|
||||||
raise MastodonIllegalArgumentError('Mismatch in base URLs between files and/or specified')
|
raise MastodonIllegalArgumentError('Mismatch in base URLs between files and/or specified')
|
||||||
self.api_base_url = try_base_url
|
self.api_base_url = try_base_url
|
||||||
|
|
||||||
|
# With new registrations we support the 4th line to store a client_name and use it as user-agent
|
||||||
|
client_name = secret_file.readline()
|
||||||
|
if client_name and self.user_agent is None:
|
||||||
|
self.user_agent = client_name.rstrip()
|
||||||
else:
|
else:
|
||||||
if self.client_secret is None:
|
if self.client_secret is None:
|
||||||
raise MastodonIllegalArgumentError('Specified client id directly, but did not supply secret')
|
raise MastodonIllegalArgumentError('Specified client id directly, but did not supply secret')
|
||||||
|
@ -716,13 +753,13 @@ class Mastodon:
|
||||||
"""
|
"""
|
||||||
if max_id != None:
|
if max_id != None:
|
||||||
max_id = self.__unpack_id(max_id)
|
max_id = self.__unpack_id(max_id)
|
||||||
|
|
||||||
if min_id != None:
|
if min_id != None:
|
||||||
min_id = self.__unpack_id(min_id)
|
min_id = self.__unpack_id(min_id)
|
||||||
|
|
||||||
if since_id != None:
|
if since_id != None:
|
||||||
since_id = self.__unpack_id(since_id)
|
since_id = self.__unpack_id(since_id)
|
||||||
|
|
||||||
params_initial = locals()
|
params_initial = locals()
|
||||||
|
|
||||||
if timeline == "local":
|
if timeline == "local":
|
||||||
|
@ -754,7 +791,7 @@ class Mastodon:
|
||||||
since_id=since_id, limit=limit)
|
since_id=since_id, limit=limit)
|
||||||
|
|
||||||
@api_version("1.0.0", "2.6.0", __DICT_VERSION_STATUS)
|
@api_version("1.0.0", "2.6.0", __DICT_VERSION_STATUS)
|
||||||
def timeline_public(self, max_id=None, min_id=None, since_id=None, limit=None, only_media=False):
|
def timeline_public(self, max_id=None, min_id=None, since_id=None, limit=None, only_media=False, remote=None):
|
||||||
"""
|
"""
|
||||||
Fetches the public / visible-network timeline, not including replies.
|
Fetches the public / visible-network timeline, not including replies.
|
||||||
|
|
||||||
|
@ -764,21 +801,24 @@ class Mastodon:
|
||||||
"""
|
"""
|
||||||
if max_id != None:
|
if max_id != None:
|
||||||
max_id = self.__unpack_id(max_id)
|
max_id = self.__unpack_id(max_id)
|
||||||
|
|
||||||
if min_id != None:
|
if min_id != None:
|
||||||
min_id = self.__unpack_id(min_id)
|
min_id = self.__unpack_id(min_id)
|
||||||
|
|
||||||
if since_id != None:
|
if since_id != None:
|
||||||
since_id = self.__unpack_id(since_id)
|
since_id = self.__unpack_id(since_id)
|
||||||
|
|
||||||
params_initial = locals()
|
params_initial = locals()
|
||||||
|
|
||||||
if only_media == False:
|
if only_media == False:
|
||||||
del params_initial['only_media']
|
del params_initial['only_media']
|
||||||
|
|
||||||
|
if remote != None:
|
||||||
|
params_initial['remote'] = remote
|
||||||
|
|
||||||
url = '/api/v1/timelines/public'
|
url = '/api/v1/timelines/public'
|
||||||
params = self.__generate_params(params_initial)
|
params = self.__generate_params(params_initial)
|
||||||
|
|
||||||
return self.__api_request('GET', url, params)
|
return self.__api_request('GET', url, params)
|
||||||
|
|
||||||
@api_version("1.0.0", "2.6.0", __DICT_VERSION_STATUS)
|
@api_version("1.0.0", "2.6.0", __DICT_VERSION_STATUS)
|
||||||
|
@ -965,10 +1005,13 @@ class Mastodon:
|
||||||
# Reading data: Notifications
|
# Reading data: Notifications
|
||||||
###
|
###
|
||||||
@api_version("1.0.0", "2.9.0", __DICT_VERSION_NOTIFICATION)
|
@api_version("1.0.0", "2.9.0", __DICT_VERSION_NOTIFICATION)
|
||||||
def notifications(self, id=None, account_id=None, max_id=None, min_id=None, since_id=None, limit=None, mentions_only=None):
|
def notifications(self, id=None, account_id=None, max_id=None, min_id=None, since_id=None, limit=None, exclude_types=None):
|
||||||
"""
|
"""
|
||||||
Fetch notifications (mentions, favourites, reblogs, follows) for the logged-in
|
Fetch notifications (mentions, favourites, reblogs, follows) for the logged-in
|
||||||
user. Pass `account_id` to get only notifications originating from the given account.
|
user. Pass `account_id` to get only notifications originating from the given account.
|
||||||
|
|
||||||
|
Parameter `exclude_types` is an array of the following `follow`, `favourite`, `reblog`,
|
||||||
|
`mention`, `poll`, `follow_request`
|
||||||
|
|
||||||
Can be passed an `id` to fetch a single notification.
|
Can be passed an `id` to fetch a single notification.
|
||||||
|
|
||||||
|
@ -1028,8 +1071,8 @@ class Mastodon:
|
||||||
"""
|
"""
|
||||||
return self.account_verify_credentials()
|
return self.account_verify_credentials()
|
||||||
|
|
||||||
@api_version("1.0.0", "2.7.0", __DICT_VERSION_STATUS)
|
@api_version("1.0.0", "2.8.0", __DICT_VERSION_STATUS)
|
||||||
def account_statuses(self, id, only_media=False, pinned=False, exclude_replies=False, max_id=None, min_id=None, since_id=None, limit=None):
|
def account_statuses(self, id, only_media=False, pinned=False, exclude_replies=False, exclude_reblogs=False, tagged=None, max_id=None, min_id=None, since_id=None, limit=None):
|
||||||
"""
|
"""
|
||||||
Fetch statuses by user `id`. Same options as `timeline()`_ are permitted.
|
Fetch statuses by user `id`. Same options as `timeline()`_ are permitted.
|
||||||
Returned toots are from the perspective of the logged-in user, i.e.
|
Returned toots are from the perspective of the logged-in user, i.e.
|
||||||
|
@ -1040,6 +1083,8 @@ class Mastodon:
|
||||||
If `pinned` is set, return only statuses that have been pinned. Note that
|
If `pinned` is set, return only statuses that have been pinned. Note that
|
||||||
as of Mastodon 2.1.0, this only works properly for instance-local users.
|
as of Mastodon 2.1.0, this only works properly for instance-local users.
|
||||||
If `exclude_replies` is set, filter out all statuses that are replies.
|
If `exclude_replies` is set, filter out all statuses that are replies.
|
||||||
|
If `exclude_reblogs` is set, filter out all statuses that are reblogs.
|
||||||
|
If `tagged` is set, return only statuses that are tagged with `tagged`. Only a single tag without a '#' is valid.
|
||||||
|
|
||||||
Does not require authentication for Mastodon versions after 2.7.0 (returns
|
Does not require authentication for Mastodon versions after 2.7.0 (returns
|
||||||
publicly visible statuses in that case), for publicly visible accounts.
|
publicly visible statuses in that case), for publicly visible accounts.
|
||||||
|
@ -1063,7 +1108,9 @@ class Mastodon:
|
||||||
del params["only_media"]
|
del params["only_media"]
|
||||||
if exclude_replies == False:
|
if exclude_replies == False:
|
||||||
del params["exclude_replies"]
|
del params["exclude_replies"]
|
||||||
|
if exclude_reblogs == False:
|
||||||
|
del params["exclude_reblogs"]
|
||||||
|
|
||||||
url = '/api/v1/accounts/{0}/statuses'.format(str(id))
|
url = '/api/v1/accounts/{0}/statuses'.format(str(id))
|
||||||
return self.__api_request('GET', url, params)
|
return self.__api_request('GET', url, params)
|
||||||
|
|
||||||
|
@ -1143,14 +1190,27 @@ class Mastodon:
|
||||||
"""
|
"""
|
||||||
Get all of the logged-in users lists which the specified user is
|
Get all of the logged-in users lists which the specified user is
|
||||||
a member of.
|
a member of.
|
||||||
|
|
||||||
Returns a list of `list dicts`_.
|
Returns a list of `list dicts`_.
|
||||||
"""
|
"""
|
||||||
id = self.__unpack_id(id)
|
id = self.__unpack_id(id)
|
||||||
params = self.__generate_params(locals(), ['id'])
|
params = self.__generate_params(locals(), ['id'])
|
||||||
url = '/api/v1/accounts/{0}/lists'.format(str(id))
|
url = '/api/v1/accounts/{0}/lists'.format(str(id))
|
||||||
return self.__api_request('GET', url, params)
|
return self.__api_request('GET', url, params)
|
||||||
|
|
||||||
|
@api_version("3.6.0", "3.6.0", __DICT_VERSION_LIST)
|
||||||
|
def accounts_note(self, id, comment=None):
|
||||||
|
"""
|
||||||
|
Add personal notes for accounts
|
||||||
|
"""
|
||||||
|
if comment != None:
|
||||||
|
comment = comment
|
||||||
|
|
||||||
|
id = self.__unpack_id(id)
|
||||||
|
params = self.__generate_params(locals(), ['id'])
|
||||||
|
url = '/api/v1/accounts/{0}/note'.format(id)
|
||||||
|
return self.__api_request('POST', url, params)
|
||||||
|
|
||||||
###
|
###
|
||||||
# Reading data: Featured hashtags
|
# Reading data: Featured hashtags
|
||||||
###
|
###
|
||||||
|
@ -1633,13 +1693,23 @@ class Mastodon:
|
||||||
# Reading data: Bookmarks
|
# Reading data: Bookmarks
|
||||||
###
|
###
|
||||||
@api_version("3.1.0", "3.1.0", __DICT_VERSION_STATUS)
|
@api_version("3.1.0", "3.1.0", __DICT_VERSION_STATUS)
|
||||||
def bookmarks(self):
|
def bookmarks(self, max_id=None, min_id=None, since_id=None, limit=None):
|
||||||
"""
|
"""
|
||||||
Get a list of statuses bookmarked by the logged-in user.
|
Get a list of statuses bookmarked by the logged-in user.
|
||||||
|
|
||||||
Returns a list of `toot dicts`_.
|
Returns a list of `toot dicts`_.
|
||||||
"""
|
"""
|
||||||
return self.__api_request('GET', '/api/v1/bookmarks')
|
if max_id != None:
|
||||||
|
max_id = self.__unpack_id(max_id)
|
||||||
|
|
||||||
|
if min_id != None:
|
||||||
|
min_id = self.__unpack_id(min_id)
|
||||||
|
|
||||||
|
if since_id != None:
|
||||||
|
since_id = self.__unpack_id(since_id)
|
||||||
|
|
||||||
|
params = self.__generate_params(locals())
|
||||||
|
return self.__api_request('GET', '/api/v1/bookmarks', params)
|
||||||
|
|
||||||
###
|
###
|
||||||
# Writing data: Statuses
|
# Writing data: Statuses
|
||||||
|
@ -1711,7 +1781,7 @@ class Mastodon:
|
||||||
|
|
||||||
if content_type != None:
|
if content_type != None:
|
||||||
if self.feature_set != "pleroma":
|
if self.feature_set != "pleroma":
|
||||||
raise MastodonIllegalArgumentError('quote_id is only available with feature set pleroma')
|
raise MastodonIllegalArgumentError('content_type is only available with feature set pleroma')
|
||||||
# It would be better to read this from nodeinfo and cache, but this is easier
|
# It would be better to read this from nodeinfo and cache, but this is easier
|
||||||
if not content_type in ["text/plain", "text/html", "text/markdown", "text/bbcode"]:
|
if not content_type in ["text/plain", "text/html", "text/markdown", "text/bbcode"]:
|
||||||
raise MastodonIllegalArgumentError('Invalid content type specified')
|
raise MastodonIllegalArgumentError('Invalid content type specified')
|
||||||
|
@ -2424,7 +2494,7 @@ class Mastodon:
|
||||||
if not status_ids is None:
|
if not status_ids is None:
|
||||||
if not isinstance(status_ids, list):
|
if not isinstance(status_ids, list):
|
||||||
status_ids = [status_ids]
|
status_ids = [status_ids]
|
||||||
status_ids = list(map(lambda x: self.__unpack_id(x), status_ids))
|
status_ids = list(map(lambda x: self.__unpack_id(x), status_ids))
|
||||||
|
|
||||||
params_initial = locals()
|
params_initial = locals()
|
||||||
if forward == False:
|
if forward == False:
|
||||||
|
@ -2924,7 +2994,100 @@ class Mastodon:
|
||||||
"""
|
"""
|
||||||
id = self.__unpack_id(id)
|
id = self.__unpack_id(id)
|
||||||
return self.__api_request('POST', '/api/v1/admin/reports/{0}/resolve'.format(id))
|
return self.__api_request('POST', '/api/v1/admin/reports/{0}/resolve'.format(id))
|
||||||
|
|
||||||
|
@api_version("3.6.0", "3.6.0", __DICT_VERSION_DOMAIN_BLOCKS)
|
||||||
|
def admin_domain_blocks_list(self):
|
||||||
|
"""
|
||||||
|
List domain blocks.
|
||||||
|
"""
|
||||||
|
return self.__api_request('GET', '/api/v1/admin/domain_blocks')
|
||||||
|
|
||||||
|
@api_version("3.6.0", "3.6.0", __DICT_VERSION_DOMAIN_BLOCKS)
|
||||||
|
def admin_domain_blocks(self, id):
|
||||||
|
"""
|
||||||
|
Shows one domain block by id.
|
||||||
|
"""
|
||||||
|
id = self.__unpack_id(id)
|
||||||
|
return self.__api_request('GET', '/api/v1/admin/domain_blocks/{0}'.format(id))
|
||||||
|
|
||||||
|
@api_version("3.6.0", "3.6.0", __DICT_VERSION_DOMAIN_BLOCKS)
|
||||||
|
def admin_domain_blocks_delete(self, id):
|
||||||
|
"""
|
||||||
|
Delete one domain block by id.
|
||||||
|
"""
|
||||||
|
id = self.__unpack_id(id)
|
||||||
|
return self.__api_request('DELETE', '/api/v1/admin/domain_blocks/{0}'.format(id))
|
||||||
|
|
||||||
|
@api_version("3.6.0", "3.6.0", __DICT_VERSION_DOMAIN_BLOCKS)
|
||||||
|
def admin_domain_blocks_create(self, domain=None, severity=None, reject_media=None, reject_reports=None, private_comment=None, public_comment=None, obfuscate=None):
|
||||||
|
"""
|
||||||
|
To create a new domain block.
|
||||||
|
If it conflicts with an existing one, returns an error with an attribute `existing_domain_block` with the rendered domain block.
|
||||||
|
"""
|
||||||
|
if severity == None:
|
||||||
|
severity = 'silence'
|
||||||
|
if reject_media == None:
|
||||||
|
reject_media = 'false'
|
||||||
|
if reject_reports == None:
|
||||||
|
reject_reports = 'false'
|
||||||
|
if private_comment != None:
|
||||||
|
private_comment = private_comment
|
||||||
|
if public_comment != None:
|
||||||
|
public_comment = public_comment
|
||||||
|
if obfuscate == None:
|
||||||
|
obfuscate = 'false'
|
||||||
|
params = self.__generate_params(locals())
|
||||||
|
return self.__api_request('POST', '/api/v1/admin/domain_blocks', params)
|
||||||
|
|
||||||
|
@api_version("3.6.0", "3.6.0", __DICT_VERSION_IP_BLOCKS)
|
||||||
|
def admin_ip_blocks_list(self, max_id=None, min_id=None, since_id=None, limit=None):
|
||||||
|
"""
|
||||||
|
List IP blocks.
|
||||||
|
"""
|
||||||
|
if max_id != None:
|
||||||
|
max_id = self.__unpack_id(max_id)
|
||||||
|
|
||||||
|
if min_id != None:
|
||||||
|
min_id = self.__unpack_id(min_id)
|
||||||
|
|
||||||
|
if since_id != None:
|
||||||
|
since_id = self.__unpack_id(since_id)
|
||||||
|
|
||||||
|
params_initial = locals()
|
||||||
|
|
||||||
|
params = self.__generate_params(params_initial)
|
||||||
|
|
||||||
|
return self.__api_request('GET', '/api/v1/admin/ip_blocks', params)
|
||||||
|
|
||||||
|
@api_version("3.6.0", "3.6.0", __DICT_VERSION_IP_BLOCKS)
|
||||||
|
def admin_ip_blocks_delete(self, id):
|
||||||
|
"""
|
||||||
|
Delete one IP block by id.
|
||||||
|
"""
|
||||||
|
id = self.__unpack_id(id)
|
||||||
|
return self.__api_request('DELETE', '/api/v1/admin/ip_blocks/{0}'.format(id))
|
||||||
|
|
||||||
|
@api_version("3.6.0", "3.6.0", __DICT_VERSION_IP_BLOCKS)
|
||||||
|
def admin_ip_blocks_create(self, ip=None, severity=None, comment=None, expires_in=None):
|
||||||
|
"""
|
||||||
|
To create a new IP block.
|
||||||
|
|
||||||
|
severity possible values:
|
||||||
|
sign_up_requires_approval
|
||||||
|
sign_up_block
|
||||||
|
no_access
|
||||||
|
"""
|
||||||
|
if ip == None:
|
||||||
|
return("Missing required IP.")
|
||||||
|
if severity == None:
|
||||||
|
severity = 'sign_up_requires_approval'
|
||||||
|
if comment == None:
|
||||||
|
comment = "blocked"
|
||||||
|
if expires_in == None:
|
||||||
|
expires_in = 86400
|
||||||
|
params = self.__generate_params(locals())
|
||||||
|
return self.__api_request('POST', '/api/v1/admin/ip_blocks', params)
|
||||||
|
|
||||||
###
|
###
|
||||||
# Push subscription crypto utilities
|
# Push subscription crypto utilities
|
||||||
###
|
###
|
||||||
|
@ -3040,8 +3203,8 @@ class Mastodon:
|
||||||
Returns the next page or None if no further data is available.
|
Returns the next page or None if no further data is available.
|
||||||
"""
|
"""
|
||||||
if isinstance(previous_page, list) and len(previous_page) != 0:
|
if isinstance(previous_page, list) and len(previous_page) != 0:
|
||||||
if hasattr(previous_page[-1], '_pagination_next'):
|
if hasattr(previous_page, '_pagination_next'):
|
||||||
params = copy.deepcopy(previous_page[-1]._pagination_next)
|
params = copy.deepcopy(previous_page._pagination_next)
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
else:
|
else:
|
||||||
|
@ -3064,8 +3227,8 @@ class Mastodon:
|
||||||
Returns the previous page or None if no further data is available.
|
Returns the previous page or None if no further data is available.
|
||||||
"""
|
"""
|
||||||
if isinstance(next_page, list) and len(next_page) != 0:
|
if isinstance(next_page, list) and len(next_page) != 0:
|
||||||
if hasattr(next_page[0], '_pagination_prev'):
|
if hasattr(next_page, '_pagination_prev'):
|
||||||
params = copy.deepcopy(next_page[0]._pagination_prev)
|
params = copy.deepcopy(next_page._pagination_prev)
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
else:
|
else:
|
||||||
|
@ -3123,6 +3286,13 @@ class Mastodon:
|
||||||
"""
|
"""
|
||||||
return self.__stream('/api/v1/streaming/public/local', listener, run_async=run_async, timeout=timeout, reconnect_async=reconnect_async, reconnect_async_wait_sec=reconnect_async_wait_sec)
|
return self.__stream('/api/v1/streaming/public/local', listener, run_async=run_async, timeout=timeout, reconnect_async=reconnect_async, reconnect_async_wait_sec=reconnect_async_wait_sec)
|
||||||
|
|
||||||
|
@api_version("1.1.0", "1.4.2", __DICT_VERSION_STATUS)
|
||||||
|
def stream_remote(self, listener, run_async=False, timeout=__DEFAULT_STREAM_TIMEOUT, reconnect_async=False, reconnect_async_wait_sec=__DEFAULT_STREAM_RECONNECT_WAIT_SEC):
|
||||||
|
"""
|
||||||
|
Streams remote public events.
|
||||||
|
"""
|
||||||
|
return self.__stream('/api/v1/streaming/public/remote', listener, run_async=run_async, timeout=timeout, reconnect_async=reconnect_async, reconnect_async_wait_sec=reconnect_async_wait_sec)
|
||||||
|
|
||||||
@api_version("1.1.0", "1.4.2", __DICT_VERSION_STATUS)
|
@api_version("1.1.0", "1.4.2", __DICT_VERSION_STATUS)
|
||||||
def stream_hashtag(self, tag, listener, local=False, run_async=False, timeout=__DEFAULT_STREAM_TIMEOUT, reconnect_async=False, reconnect_async_wait_sec=__DEFAULT_STREAM_RECONNECT_WAIT_SEC):
|
def stream_hashtag(self, tag, listener, local=False, run_async=False, timeout=__DEFAULT_STREAM_TIMEOUT, reconnect_async=False, reconnect_async_wait_sec=__DEFAULT_STREAM_RECONNECT_WAIT_SEC):
|
||||||
"""
|
"""
|
||||||
|
@ -3230,7 +3400,7 @@ class Mastodon:
|
||||||
if (key in json_object and isinstance(json_object[key], six.text_type)):
|
if (key in json_object and isinstance(json_object[key], six.text_type)):
|
||||||
if json_object[key].lower() == 'true':
|
if json_object[key].lower() == 'true':
|
||||||
json_object[key] = True
|
json_object[key] = True
|
||||||
if json_object[key].lower() == 'False':
|
if json_object[key].lower() == 'false':
|
||||||
json_object[key] = False
|
json_object[key] = False
|
||||||
return json_object
|
return json_object
|
||||||
|
|
||||||
|
@ -3304,6 +3474,10 @@ class Mastodon:
|
||||||
if not access_token_override is None:
|
if not access_token_override is None:
|
||||||
headers['Authorization'] = 'Bearer ' + access_token_override
|
headers['Authorization'] = 'Bearer ' + access_token_override
|
||||||
|
|
||||||
|
# Add user-agent
|
||||||
|
if self.user_agent:
|
||||||
|
headers['User-Agent'] = self.user_agent
|
||||||
|
|
||||||
# Determine base URL
|
# Determine base URL
|
||||||
base_url = self.api_base_url
|
base_url = self.api_base_url
|
||||||
if not base_url_override is None:
|
if not base_url_override is None:
|
||||||
|
@ -3443,6 +3617,7 @@ class Mastodon:
|
||||||
if isinstance(response, list) and \
|
if isinstance(response, list) and \
|
||||||
'Link' in response_object.headers and \
|
'Link' in response_object.headers and \
|
||||||
response_object.headers['Link'] != "":
|
response_object.headers['Link'] != "":
|
||||||
|
response = AttribAccessList(response)
|
||||||
tmp_urls = requests.utils.parse_header_links(
|
tmp_urls = requests.utils.parse_header_links(
|
||||||
response_object.headers['Link'].rstrip('>').replace('>,<', ',<'))
|
response_object.headers['Link'].rstrip('>').replace('>,<', ',<'))
|
||||||
for url in tmp_urls:
|
for url in tmp_urls:
|
||||||
|
@ -3467,7 +3642,12 @@ class Mastodon:
|
||||||
del next_params['since_id']
|
del next_params['since_id']
|
||||||
if "min_id" in next_params:
|
if "min_id" in next_params:
|
||||||
del next_params['min_id']
|
del next_params['min_id']
|
||||||
response[-1]._pagination_next = next_params
|
response._pagination_next = next_params
|
||||||
|
|
||||||
|
# Maybe other API users rely on the pagination info in the last item
|
||||||
|
# Will be removed in future
|
||||||
|
if isinstance(response[-1], AttribAccessDict):
|
||||||
|
response[-1]._pagination_next = next_params
|
||||||
|
|
||||||
if url['rel'] == 'prev':
|
if url['rel'] == 'prev':
|
||||||
# Be paranoid and extract since_id or min_id specifically
|
# Be paranoid and extract since_id or min_id specifically
|
||||||
|
@ -3486,8 +3666,13 @@ class Mastodon:
|
||||||
prev_params['since_id'] = since_id
|
prev_params['since_id'] = since_id
|
||||||
if "max_id" in prev_params:
|
if "max_id" in prev_params:
|
||||||
del prev_params['max_id']
|
del prev_params['max_id']
|
||||||
response[0]._pagination_prev = prev_params
|
response._pagination_prev = prev_params
|
||||||
|
|
||||||
|
# Maybe other API users rely on the pagination info in the first item
|
||||||
|
# Will be removed in future
|
||||||
|
if isinstance(response[0], AttribAccessDict):
|
||||||
|
response[0]._pagination_prev = prev_params
|
||||||
|
|
||||||
# New and fantastico (post-2.6.0): min_id pagination
|
# New and fantastico (post-2.6.0): min_id pagination
|
||||||
matchgroups = re.search(r"[?&]min_id=([^&]+)", prev_url)
|
matchgroups = re.search(r"[?&]min_id=([^&]+)", prev_url)
|
||||||
if matchgroups:
|
if matchgroups:
|
||||||
|
@ -3501,7 +3686,12 @@ class Mastodon:
|
||||||
prev_params['min_id'] = min_id
|
prev_params['min_id'] = min_id
|
||||||
if "max_id" in prev_params:
|
if "max_id" in prev_params:
|
||||||
del prev_params['max_id']
|
del prev_params['max_id']
|
||||||
response[0]._pagination_prev = prev_params
|
response._pagination_prev = prev_params
|
||||||
|
|
||||||
|
# Maybe other API users rely on the pagination info in the first item
|
||||||
|
# Will be removed in future
|
||||||
|
if isinstance(response[0], AttribAccessDict):
|
||||||
|
response[0]._pagination_prev = prev_params
|
||||||
|
|
||||||
return response
|
return response
|
||||||
|
|
||||||
|
@ -3546,6 +3736,8 @@ class Mastodon:
|
||||||
# Connect function (called and then potentially passed to async handler)
|
# Connect function (called and then potentially passed to async handler)
|
||||||
def connect_func():
|
def connect_func():
|
||||||
headers = {"Authorization": "Bearer " + self.access_token} if self.access_token else {}
|
headers = {"Authorization": "Bearer " + self.access_token} if self.access_token else {}
|
||||||
|
if self.user_agent:
|
||||||
|
headers['User-Agent'] = self.user_agent
|
||||||
connection = self.session.get(url + endpoint, headers = headers, data = params, stream = True,
|
connection = self.session.get(url + endpoint, headers = headers, data = params, stream = True,
|
||||||
timeout=(self.request_timeout, timeout))
|
timeout=(self.request_timeout, timeout))
|
||||||
|
|
||||||
|
@ -3567,7 +3759,8 @@ class Mastodon:
|
||||||
|
|
||||||
def close(self):
|
def close(self):
|
||||||
self.closed = True
|
self.closed = True
|
||||||
self.connection.close()
|
if not self.connection is None:
|
||||||
|
self.connection.close()
|
||||||
|
|
||||||
def is_alive(self):
|
def is_alive(self):
|
||||||
return self._thread.is_alive()
|
return self._thread.is_alive()
|
||||||
|
@ -3578,6 +3771,14 @@ class Mastodon:
|
||||||
else:
|
else:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
def _sleep_attentive(self):
|
||||||
|
if self._thread != threading.current_thread():
|
||||||
|
raise RuntimeError ("Illegal call from outside the stream_handle thread")
|
||||||
|
time_remaining = self.reconnect_async_wait_sec
|
||||||
|
while time_remaining>0 and not self.closed:
|
||||||
|
time.sleep(0.5)
|
||||||
|
time_remaining -= 0.5
|
||||||
|
|
||||||
def _threadproc(self):
|
def _threadproc(self):
|
||||||
self._thread = threading.current_thread()
|
self._thread = threading.current_thread()
|
||||||
|
|
||||||
|
@ -3599,16 +3800,26 @@ class Mastodon:
|
||||||
self.reconnecting = True
|
self.reconnecting = True
|
||||||
connect_success = False
|
connect_success = False
|
||||||
while not connect_success:
|
while not connect_success:
|
||||||
connect_success = True
|
if self.closed:
|
||||||
|
# Someone from outside stopped the streaming
|
||||||
|
self.running = False
|
||||||
|
break
|
||||||
try:
|
try:
|
||||||
self.connection = self.connect_func()
|
the_connection = self.connect_func()
|
||||||
if self.connection.status_code != 200:
|
if the_connection.status_code != 200:
|
||||||
time.sleep(self.reconnect_async_wait_sec)
|
exception = MastodonNetworkError(f"Could not connect to server. "
|
||||||
connect_success = False
|
f"HTTP status: {the_connection.status_code}")
|
||||||
exception = MastodonNetworkError("Could not connect to server.")
|
|
||||||
listener.on_abort(exception)
|
listener.on_abort(exception)
|
||||||
|
self._sleep_attentive()
|
||||||
|
if self.closed:
|
||||||
|
# Here we have maybe a rare race condition. Exactly on connect, someone
|
||||||
|
# stopped the streaming before. We close the previous established connection:
|
||||||
|
the_connection.close()
|
||||||
|
else:
|
||||||
|
self.connection = the_connection
|
||||||
|
connect_success = True
|
||||||
except:
|
except:
|
||||||
time.sleep(self.reconnect_async_wait_sec)
|
self._sleep_attentive()
|
||||||
connect_success = False
|
connect_success = False
|
||||||
self.reconnecting = False
|
self.reconnecting = False
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -45,6 +45,16 @@ class StreamListener(object):
|
||||||
contains the resulting conversation dict."""
|
contains the resulting conversation dict."""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def on_unknown_event(self, name, unknown_event = None):
|
||||||
|
"""An unknown mastodon API event has been received. The name contains the event-name and unknown_event
|
||||||
|
contains the content of the unknown event.
|
||||||
|
|
||||||
|
This function must be implemented, if unknown events should be handled without an error.
|
||||||
|
"""
|
||||||
|
exception = MastodonMalformedEventError('Bad event type', name)
|
||||||
|
self.on_abort(exception)
|
||||||
|
raise exception
|
||||||
|
|
||||||
def handle_heartbeat(self):
|
def handle_heartbeat(self):
|
||||||
"""The server has sent us a keep-alive message. This callback may be
|
"""The server has sent us a keep-alive message. This callback may be
|
||||||
useful to carry out periodic housekeeping tasks, or just to confirm
|
useful to carry out periodic housekeeping tasks, or just to confirm
|
||||||
|
@ -56,6 +66,11 @@ class StreamListener(object):
|
||||||
Handles a stream of events from the Mastodon server. When each event
|
Handles a stream of events from the Mastodon server. When each event
|
||||||
is received, the corresponding .on_[name]() method is called.
|
is received, the corresponding .on_[name]() method is called.
|
||||||
|
|
||||||
|
When the Mastodon API changes, the on_unknown_event(name, content)
|
||||||
|
function is called.
|
||||||
|
The default behavior is to throw an error. Define a callback handler
|
||||||
|
to intercept unknown events if needed (and avoid errors)
|
||||||
|
|
||||||
response; a requests response object with the open stream for reading.
|
response; a requests response object with the open stream for reading.
|
||||||
"""
|
"""
|
||||||
event = {}
|
event = {}
|
||||||
|
@ -137,33 +152,32 @@ class StreamListener(object):
|
||||||
exception,
|
exception,
|
||||||
err
|
err
|
||||||
)
|
)
|
||||||
|
# New mastodon API also supports event names with dots:
|
||||||
handler_name = 'on_' + name
|
handler_name = 'on_' + name.replace('.', '_')
|
||||||
try:
|
# A generic way to handle unknown events to make legacy code more stable for future changes
|
||||||
handler = getattr(self, handler_name)
|
handler = getattr(self, handler_name, self.on_unknown_event)
|
||||||
except AttributeError as err:
|
if handler != self.on_unknown_event:
|
||||||
exception = MastodonMalformedEventError('Bad event type', name)
|
|
||||||
self.on_abort(exception)
|
|
||||||
six.raise_from(
|
|
||||||
exception,
|
|
||||||
err
|
|
||||||
)
|
|
||||||
else:
|
|
||||||
handler(payload)
|
handler(payload)
|
||||||
|
else:
|
||||||
|
handler(name, payload)
|
||||||
|
|
||||||
|
|
||||||
class CallbackStreamListener(StreamListener):
|
class CallbackStreamListener(StreamListener):
|
||||||
"""
|
"""
|
||||||
Simple callback stream handler class.
|
Simple callback stream handler class.
|
||||||
Can optionally additionally send local update events to a separate handler.
|
Can optionally additionally send local update events to a separate handler.
|
||||||
|
Define an unknown_event_handler for new Mastodon API events. If not, the
|
||||||
|
listener will raise an error on new, not handled, events from the API.
|
||||||
"""
|
"""
|
||||||
def __init__(self, update_handler = None, local_update_handler = None, delete_handler = None, notification_handler = None, conversation_handler = None):
|
def __init__(self, update_handler = None, local_update_handler = None, delete_handler = None, notification_handler = None, conversation_handler = None, unknown_event_handler = None):
|
||||||
super(CallbackStreamListener, self).__init__()
|
super(CallbackStreamListener, self).__init__()
|
||||||
self.update_handler = update_handler
|
self.update_handler = update_handler
|
||||||
self.local_update_handler = local_update_handler
|
self.local_update_handler = local_update_handler
|
||||||
self.delete_handler = delete_handler
|
self.delete_handler = delete_handler
|
||||||
self.notification_handler = notification_handler
|
self.notification_handler = notification_handler
|
||||||
self.conversation_handler = conversation_handler
|
self.conversation_handler = conversation_handler
|
||||||
|
self.unknown_event_handler = unknown_event_handler
|
||||||
|
|
||||||
def on_update(self, status):
|
def on_update(self, status):
|
||||||
if self.update_handler != None:
|
if self.update_handler != None:
|
||||||
self.update_handler(status)
|
self.update_handler(status)
|
||||||
|
@ -188,3 +202,11 @@ class CallbackStreamListener(StreamListener):
|
||||||
def on_conversation(self, conversation):
|
def on_conversation(self, conversation):
|
||||||
if self.conversation_handler != None:
|
if self.conversation_handler != None:
|
||||||
self.conversation_handler(conversation)
|
self.conversation_handler(conversation)
|
||||||
|
|
||||||
|
def on_unknown_event(self, name, unknown_event = None):
|
||||||
|
if self.unknown_event_handler != None:
|
||||||
|
self.unknown_event_handler(name, unknown_event)
|
||||||
|
else:
|
||||||
|
exception = MastodonMalformedEventError('Bad event type', name)
|
||||||
|
self.on_abort(exception)
|
||||||
|
raise exception
|
||||||
|
|
18
setup.py
18
setup.py
|
@ -1,4 +1,6 @@
|
||||||
from setuptools import setup
|
import setuptools
|
||||||
|
|
||||||
|
VERSION = '1.5.5.4'
|
||||||
|
|
||||||
test_deps = [
|
test_deps = [
|
||||||
'pytest',
|
'pytest',
|
||||||
|
@ -25,10 +27,16 @@ extras = {
|
||||||
"blurhash": blurhash_deps,
|
"blurhash": blurhash_deps,
|
||||||
}
|
}
|
||||||
|
|
||||||
setup(name='Mastodon.py',
|
with open('README.md', 'r', encoding='utf-8') as fh:
|
||||||
version='1.5.1',
|
long_description = fh.read()
|
||||||
description='Python wrapper for the Mastodon API',
|
|
||||||
|
setuptools.setup(
|
||||||
|
name='Mastodonplus.py',
|
||||||
|
version=VERSION,
|
||||||
|
description='Python wrapper for the Mastodon API (new endpoints)',
|
||||||
packages=['mastodon'],
|
packages=['mastodon'],
|
||||||
|
long_description=long_description,
|
||||||
|
long_description_content_type='text/markdown',
|
||||||
install_requires=[
|
install_requires=[
|
||||||
'requests>=2.4.2',
|
'requests>=2.4.2',
|
||||||
'python-dateutil',
|
'python-dateutil',
|
||||||
|
@ -39,7 +47,7 @@ setup(name='Mastodon.py',
|
||||||
] + blurhash_deps,
|
] + blurhash_deps,
|
||||||
tests_require=test_deps,
|
tests_require=test_deps,
|
||||||
extras_require=extras,
|
extras_require=extras,
|
||||||
url='https://github.com/halcy/Mastodon.py',
|
url='https://git.mastodont.cat/spla/Mastodonplus.py',
|
||||||
author='Lorenz Diener',
|
author='Lorenz Diener',
|
||||||
author_email='lorenzd+mastodonpypypi@gmail.com',
|
author_email='lorenzd+mastodonpypypi@gmail.com',
|
||||||
license='MIT',
|
license='MIT',
|
||||||
|
|
|
@ -26,7 +26,7 @@ This test suite uses [VCR.py][] to record requests to Mastodon and replay them i
|
||||||
If you want to add or change tests, you will need a Mastodon development server running on `http://localhost:3000`, with the default `admin` user and default password.
|
If you want to add or change tests, you will need a Mastodon development server running on `http://localhost:3000`, with the default `admin` user and default password.
|
||||||
To set this up, follow the development guide and set up the database using "rails db:setup".
|
To set this up, follow the development guide and set up the database using "rails db:setup".
|
||||||
|
|
||||||
It also needs a test OAuth app and an additional test user to be set up by applying the provided `setup.sql` to Mastodon's database:
|
It also needs a test OAuth app-registriation and an additional test user to be set up by applying the provided `setup.sql` to Mastodon's database:
|
||||||
|
|
||||||
psql -d mastodon_development < tests/setup.sql
|
psql -d mastodon_development < tests/setup.sql
|
||||||
|
|
||||||
|
|
|
@ -2,174 +2,441 @@ interactions:
|
||||||
- request:
|
- request:
|
||||||
body: status=Toot%21
|
body: status=Toot%21
|
||||||
headers:
|
headers:
|
||||||
Accept: ['*/*']
|
Accept:
|
||||||
Accept-Encoding: ['gzip, deflate']
|
- '*/*'
|
||||||
Authorization: [Bearer __MASTODON_PY_TEST_ACCESS_TOKEN]
|
Accept-Encoding:
|
||||||
Connection: [keep-alive]
|
- gzip, deflate
|
||||||
Content-Length: ['14']
|
Authorization:
|
||||||
Content-Type: [application/x-www-form-urlencoded]
|
- Bearer __MASTODON_PY_TEST_ACCESS_TOKEN
|
||||||
User-Agent: [python-requests/2.18.4]
|
Connection:
|
||||||
|
- keep-alive
|
||||||
|
Content-Length:
|
||||||
|
- '14'
|
||||||
|
Content-Type:
|
||||||
|
- application/x-www-form-urlencoded
|
||||||
|
User-Agent:
|
||||||
|
- python-requests/2.22.0
|
||||||
method: POST
|
method: POST
|
||||||
uri: http://localhost:3000/api/v1/statuses
|
uri: http://localhost:3000/api/v1/statuses
|
||||||
response:
|
response:
|
||||||
body: {string: '{"id":"103704183225122470","created_at":"2020-02-22T19:37:36.738Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"public","language":"ja","uri":"http://localhost/users/mastodonpy_test/statuses/103704183225122470","url":"http://localhost/@mastodonpy_test/103704183225122470","replies_count":0,"reblogs_count":0,"favourites_count":0,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"pinned":false,"content":"\u003cp\u003eToot!\u003c/p\u003e","reblog":null,"application":{"name":"Mastodon.py
|
body:
|
||||||
test suite","website":null},"account":{"id":"1234567890123456","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":false,"bot":false,"discoverable":false,"group":false,"created_at":"2020-02-22T20:26:54.402Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@mastodonpy_test","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":3,"last_status_at":"2020-02-22","emojis":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null}'}
|
string: '{"id":"108532515807337403","created_at":"2022-06-24T12:46:05.129Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"public","language":"ja","uri":"http://localhost/users/mastodonpy_test/statuses/108532515807337403","url":"http://localhost/@mastodonpy_test/108532515807337403","replies_count":0,"reblogs_count":0,"favourites_count":0,"edited_at":null,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"pinned":false,"content":"\u003cp\u003eToot!\u003c/p\u003e","reblog":null,"application":{"name":"Mastodon.py
|
||||||
|
test suite","website":null},"account":{"id":"1234567890123456","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":true,"bot":false,"discoverable":null,"group":false,"created_at":"2022-06-24T00:00:00.000Z","note":"","url":"http://localhost/@mastodonpy_test","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":1,"last_status_at":"2022-06-24","emojis":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null}'
|
||||||
headers:
|
headers:
|
||||||
Cache-Control: ['no-cache, no-store']
|
Cache-Control:
|
||||||
Content-Type: [application/json; charset=utf-8]
|
- no-store
|
||||||
Referrer-Policy: [strict-origin-when-cross-origin]
|
Content-Security-Policy:
|
||||||
Transfer-Encoding: [chunked]
|
- 'base-uri ''none''; default-src ''none''; frame-ancestors ''none''; font-src
|
||||||
Vary: ['Accept-Encoding, Origin']
|
''self'' http://localhost; img-src ''self'' https: data: blob: http://localhost;
|
||||||
X-Content-Type-Options: [nosniff]
|
style-src ''self'' http://localhost ''nonce-s4DtHaGKm+Sv7S0opGjkuA==''; media-src
|
||||||
X-Download-Options: [noopen]
|
''self'' https: data: http://localhost; frame-src ''self'' https:; manifest-src
|
||||||
X-Frame-Options: [SAMEORIGIN]
|
''self'' http://localhost; connect-src ''self'' data: blob: http://localhost
|
||||||
X-Permitted-Cross-Domain-Policies: [none]
|
http://files.example.com ws://localhost:4000 ws://localhost:3035 http://localhost:3035;
|
||||||
X-Request-Id: [4c259279-4810-4065-bda7-44fdd2e5e769]
|
script-src ''self'' ''unsafe-inline'' ''unsafe-eval'' http://localhost; child-src
|
||||||
X-Runtime: ['0.160125']
|
''self'' blob: http://localhost; worker-src ''self'' blob: http://localhost'
|
||||||
X-XSS-Protection: [1; mode=block]
|
Content-Type:
|
||||||
content-length: ['1320']
|
- application/json; charset=utf-8
|
||||||
status: {code: 200, message: OK}
|
ETag:
|
||||||
|
- W/"16c19c98c5667003bada6cc08d6a9efd"
|
||||||
|
Referrer-Policy:
|
||||||
|
- strict-origin-when-cross-origin
|
||||||
|
Transfer-Encoding:
|
||||||
|
- chunked
|
||||||
|
Vary:
|
||||||
|
- Accept, Accept-Encoding, Origin
|
||||||
|
X-Content-Type-Options:
|
||||||
|
- nosniff
|
||||||
|
X-Download-Options:
|
||||||
|
- noopen
|
||||||
|
X-Frame-Options:
|
||||||
|
- SAMEORIGIN
|
||||||
|
X-Permitted-Cross-Domain-Policies:
|
||||||
|
- none
|
||||||
|
X-RateLimit-Limit:
|
||||||
|
- '300'
|
||||||
|
X-RateLimit-Remaining:
|
||||||
|
- '290'
|
||||||
|
X-RateLimit-Reset:
|
||||||
|
- '2022-06-24T15:00:00.156190Z'
|
||||||
|
X-Request-Id:
|
||||||
|
- a38516b7-de3e-4c49-9405-0bded1f29145
|
||||||
|
X-Runtime:
|
||||||
|
- '0.047610'
|
||||||
|
X-XSS-Protection:
|
||||||
|
- 1; mode=block
|
||||||
|
content-length:
|
||||||
|
- '1308'
|
||||||
|
status:
|
||||||
|
code: 200
|
||||||
|
message: OK
|
||||||
- request:
|
- request:
|
||||||
body: null
|
body: null
|
||||||
headers:
|
headers:
|
||||||
Accept: ['*/*']
|
Accept:
|
||||||
Accept-Encoding: ['gzip, deflate']
|
- '*/*'
|
||||||
Authorization: [Bearer __MASTODON_PY_TEST_ACCESS_TOKEN]
|
Accept-Encoding:
|
||||||
Connection: [keep-alive]
|
- gzip, deflate
|
||||||
Content-Length: ['0']
|
Authorization:
|
||||||
User-Agent: [python-requests/2.18.4]
|
- Bearer __MASTODON_PY_TEST_ACCESS_TOKEN
|
||||||
|
Connection:
|
||||||
|
- keep-alive
|
||||||
|
Content-Length:
|
||||||
|
- '0'
|
||||||
|
User-Agent:
|
||||||
|
- python-requests/2.22.0
|
||||||
method: POST
|
method: POST
|
||||||
uri: http://localhost:3000/api/v1/statuses/103704183225122470/bookmark
|
uri: http://localhost:3000/api/v1/statuses/108532515807337403/bookmark
|
||||||
response:
|
response:
|
||||||
body: {string: '{"id":"103704183225122470","created_at":"2020-02-22T19:37:36.738Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"public","language":"ja","uri":"http://localhost/users/mastodonpy_test/statuses/103704183225122470","url":"http://localhost/@mastodonpy_test/103704183225122470","replies_count":0,"reblogs_count":0,"favourites_count":0,"favourited":false,"reblogged":false,"muted":false,"bookmarked":true,"pinned":false,"content":"\u003cp\u003eToot!\u003c/p\u003e","reblog":null,"application":{"name":"Mastodon.py
|
body:
|
||||||
test suite","website":null},"account":{"id":"1234567890123456","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":false,"bot":false,"discoverable":false,"group":false,"created_at":"2020-02-22T20:26:54.402Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@mastodonpy_test","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":3,"last_status_at":"2020-02-22","emojis":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null}'}
|
string: '{"id":"108532515807337403","created_at":"2022-06-24T12:46:05.129Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"public","language":"ja","uri":"http://localhost/users/mastodonpy_test/statuses/108532515807337403","url":"http://localhost/@mastodonpy_test/108532515807337403","replies_count":0,"reblogs_count":0,"favourites_count":0,"edited_at":null,"favourited":false,"reblogged":false,"muted":false,"bookmarked":true,"pinned":false,"content":"\u003cp\u003eToot!\u003c/p\u003e","reblog":null,"application":{"name":"Mastodon.py
|
||||||
|
test suite","website":null},"account":{"id":"1234567890123456","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":true,"bot":false,"discoverable":null,"group":false,"created_at":"2022-06-24T00:00:00.000Z","note":"","url":"http://localhost/@mastodonpy_test","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":1,"last_status_at":"2022-06-24","emojis":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null}'
|
||||||
headers:
|
headers:
|
||||||
Cache-Control: ['no-cache, no-store']
|
Cache-Control:
|
||||||
Content-Type: [application/json; charset=utf-8]
|
- no-store
|
||||||
Referrer-Policy: [strict-origin-when-cross-origin]
|
Content-Security-Policy:
|
||||||
Transfer-Encoding: [chunked]
|
- 'base-uri ''none''; default-src ''none''; frame-ancestors ''none''; font-src
|
||||||
Vary: ['Accept-Encoding, Origin']
|
''self'' http://localhost; img-src ''self'' https: data: blob: http://localhost;
|
||||||
X-Content-Type-Options: [nosniff]
|
style-src ''self'' http://localhost ''nonce-r/DodIkic+v9H9lAcksQVw==''; media-src
|
||||||
X-Download-Options: [noopen]
|
''self'' https: data: http://localhost; frame-src ''self'' https:; manifest-src
|
||||||
X-Frame-Options: [SAMEORIGIN]
|
''self'' http://localhost; connect-src ''self'' data: blob: http://localhost
|
||||||
X-Permitted-Cross-Domain-Policies: [none]
|
http://files.example.com ws://localhost:4000 ws://localhost:3035 http://localhost:3035;
|
||||||
X-Request-Id: [a0ef24c0-bc8d-45ef-80af-0737f40f4191]
|
script-src ''self'' ''unsafe-inline'' ''unsafe-eval'' http://localhost; child-src
|
||||||
X-Runtime: ['0.157864']
|
''self'' blob: http://localhost; worker-src ''self'' blob: http://localhost'
|
||||||
X-XSS-Protection: [1; mode=block]
|
Content-Type:
|
||||||
content-length: ['1319']
|
- application/json; charset=utf-8
|
||||||
status: {code: 200, message: OK}
|
ETag:
|
||||||
|
- W/"bb1e121980e105d13ea65b61a8fe3f9e"
|
||||||
|
Referrer-Policy:
|
||||||
|
- strict-origin-when-cross-origin
|
||||||
|
Transfer-Encoding:
|
||||||
|
- chunked
|
||||||
|
Vary:
|
||||||
|
- Accept, Accept-Encoding, Origin
|
||||||
|
X-Content-Type-Options:
|
||||||
|
- nosniff
|
||||||
|
X-Download-Options:
|
||||||
|
- noopen
|
||||||
|
X-Frame-Options:
|
||||||
|
- SAMEORIGIN
|
||||||
|
X-Permitted-Cross-Domain-Policies:
|
||||||
|
- none
|
||||||
|
X-Request-Id:
|
||||||
|
- 4af13637-38f4-41d6-ad47-756de2626bf3
|
||||||
|
X-Runtime:
|
||||||
|
- '0.041993'
|
||||||
|
X-XSS-Protection:
|
||||||
|
- 1; mode=block
|
||||||
|
content-length:
|
||||||
|
- '1307'
|
||||||
|
status:
|
||||||
|
code: 200
|
||||||
|
message: OK
|
||||||
- request:
|
- request:
|
||||||
body: null
|
body: null
|
||||||
headers:
|
headers:
|
||||||
Accept: ['*/*']
|
Accept:
|
||||||
Accept-Encoding: ['gzip, deflate']
|
- '*/*'
|
||||||
Authorization: [Bearer __MASTODON_PY_TEST_ACCESS_TOKEN]
|
Accept-Encoding:
|
||||||
Connection: [keep-alive]
|
- gzip, deflate
|
||||||
User-Agent: [python-requests/2.18.4]
|
Authorization:
|
||||||
|
- Bearer __MASTODON_PY_TEST_ACCESS_TOKEN
|
||||||
|
Connection:
|
||||||
|
- keep-alive
|
||||||
|
User-Agent:
|
||||||
|
- python-requests/2.22.0
|
||||||
method: GET
|
method: GET
|
||||||
uri: http://localhost:3000/api/v1/bookmarks
|
uri: http://localhost:3000/api/v1/bookmarks
|
||||||
response:
|
response:
|
||||||
body: {string: '[{"id":"103704183225122470","created_at":"2020-02-22T19:37:36.738Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"public","language":"ja","uri":"http://localhost/users/mastodonpy_test/statuses/103704183225122470","url":"http://localhost/@mastodonpy_test/103704183225122470","replies_count":0,"reblogs_count":0,"favourites_count":0,"favourited":false,"reblogged":false,"muted":false,"bookmarked":true,"pinned":false,"content":"\u003cp\u003eToot!\u003c/p\u003e","reblog":null,"application":{"name":"Mastodon.py
|
body:
|
||||||
test suite","website":null},"account":{"id":"1234567890123456","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":false,"bot":false,"discoverable":false,"group":false,"created_at":"2020-02-22T20:26:54.402Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@mastodonpy_test","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":3,"last_status_at":"2020-02-22","emojis":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null}]'}
|
string: '[{"id":"108532515807337403","created_at":"2022-06-24T12:46:05.129Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"public","language":"ja","uri":"http://localhost/users/mastodonpy_test/statuses/108532515807337403","url":"http://localhost/@mastodonpy_test/108532515807337403","replies_count":0,"reblogs_count":0,"favourites_count":0,"edited_at":null,"favourited":false,"reblogged":false,"muted":false,"bookmarked":true,"pinned":false,"content":"\u003cp\u003eToot!\u003c/p\u003e","reblog":null,"application":{"name":"Mastodon.py
|
||||||
|
test suite","website":null},"account":{"id":"1234567890123456","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":true,"bot":false,"discoverable":null,"group":false,"created_at":"2022-06-24T00:00:00.000Z","note":"","url":"http://localhost/@mastodonpy_test","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":1,"last_status_at":"2022-06-24","emojis":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null}]'
|
||||||
headers:
|
headers:
|
||||||
Cache-Control: ['no-cache, no-store']
|
Cache-Control:
|
||||||
Content-Type: [application/json; charset=utf-8]
|
- no-store
|
||||||
Link: ['<http://localhost:3000/api/v1/bookmarks?min_id=2>; rel="prev"']
|
Content-Security-Policy:
|
||||||
Referrer-Policy: [strict-origin-when-cross-origin]
|
- 'base-uri ''none''; default-src ''none''; frame-ancestors ''none''; font-src
|
||||||
Transfer-Encoding: [chunked]
|
''self'' http://localhost; img-src ''self'' https: data: blob: http://localhost;
|
||||||
Vary: ['Accept-Encoding, Origin']
|
style-src ''self'' http://localhost ''nonce-EEFQZtT2hj45UYMa5FifxA==''; media-src
|
||||||
X-Content-Type-Options: [nosniff]
|
''self'' https: data: http://localhost; frame-src ''self'' https:; manifest-src
|
||||||
X-Download-Options: [noopen]
|
''self'' http://localhost; connect-src ''self'' data: blob: http://localhost
|
||||||
X-Frame-Options: [SAMEORIGIN]
|
http://files.example.com ws://localhost:4000 ws://localhost:3035 http://localhost:3035;
|
||||||
X-Permitted-Cross-Domain-Policies: [none]
|
script-src ''self'' ''unsafe-inline'' ''unsafe-eval'' http://localhost; child-src
|
||||||
X-Request-Id: [e6548f1e-3d17-46be-aca7-f310783119a8]
|
''self'' blob: http://localhost; worker-src ''self'' blob: http://localhost'
|
||||||
X-Runtime: ['0.075518']
|
Content-Type:
|
||||||
X-XSS-Protection: [1; mode=block]
|
- application/json; charset=utf-8
|
||||||
content-length: ['1321']
|
ETag:
|
||||||
status: {code: 200, message: OK}
|
- W/"e28cea671d77758e8cd2652347a030d1"
|
||||||
|
Link:
|
||||||
|
- <http://localhost:3000/api/v1/bookmarks?min_id=11>; rel="prev"
|
||||||
|
Referrer-Policy:
|
||||||
|
- strict-origin-when-cross-origin
|
||||||
|
Transfer-Encoding:
|
||||||
|
- chunked
|
||||||
|
Vary:
|
||||||
|
- Accept, Accept-Encoding, Origin
|
||||||
|
X-Content-Type-Options:
|
||||||
|
- nosniff
|
||||||
|
X-Download-Options:
|
||||||
|
- noopen
|
||||||
|
X-Frame-Options:
|
||||||
|
- SAMEORIGIN
|
||||||
|
X-Permitted-Cross-Domain-Policies:
|
||||||
|
- none
|
||||||
|
X-Request-Id:
|
||||||
|
- 0fe7aaf8-add4-4523-a98f-22608f714cad
|
||||||
|
X-Runtime:
|
||||||
|
- '0.036771'
|
||||||
|
X-XSS-Protection:
|
||||||
|
- 1; mode=block
|
||||||
|
content-length:
|
||||||
|
- '1309'
|
||||||
|
status:
|
||||||
|
code: 200
|
||||||
|
message: OK
|
||||||
- request:
|
- request:
|
||||||
body: null
|
body: null
|
||||||
headers:
|
headers:
|
||||||
Accept: ['*/*']
|
Accept:
|
||||||
Accept-Encoding: ['gzip, deflate']
|
- '*/*'
|
||||||
Authorization: [Bearer __MASTODON_PY_TEST_ACCESS_TOKEN]
|
Accept-Encoding:
|
||||||
Connection: [keep-alive]
|
- gzip, deflate
|
||||||
Content-Length: ['0']
|
Authorization:
|
||||||
User-Agent: [python-requests/2.18.4]
|
- Bearer __MASTODON_PY_TEST_ACCESS_TOKEN
|
||||||
method: POST
|
Connection:
|
||||||
uri: http://localhost:3000/api/v1/statuses/103704183225122470/unbookmark
|
- keep-alive
|
||||||
|
User-Agent:
|
||||||
|
- python-requests/2.22.0
|
||||||
|
method: GET
|
||||||
|
uri: http://localhost:3000/api/v1/bookmarks?limit=1
|
||||||
response:
|
response:
|
||||||
body: {string: '{"id":"103704183225122470","created_at":"2020-02-22T19:37:36.738Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"public","language":"ja","uri":"http://localhost/users/mastodonpy_test/statuses/103704183225122470","url":"http://localhost/@mastodonpy_test/103704183225122470","replies_count":0,"reblogs_count":0,"favourites_count":0,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"pinned":false,"content":"\u003cp\u003eToot!\u003c/p\u003e","reblog":null,"application":{"name":"Mastodon.py
|
body:
|
||||||
test suite","website":null},"account":{"id":"1234567890123456","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":false,"bot":false,"discoverable":false,"group":false,"created_at":"2020-02-22T20:26:54.402Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@mastodonpy_test","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":3,"last_status_at":"2020-02-22","emojis":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null}'}
|
string: '[{"id":"108532515807337403","created_at":"2022-06-24T12:46:05.129Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"public","language":"ja","uri":"http://localhost/users/mastodonpy_test/statuses/108532515807337403","url":"http://localhost/@mastodonpy_test/108532515807337403","replies_count":0,"reblogs_count":0,"favourites_count":0,"edited_at":null,"favourited":false,"reblogged":false,"muted":false,"bookmarked":true,"pinned":false,"content":"\u003cp\u003eToot!\u003c/p\u003e","reblog":null,"application":{"name":"Mastodon.py
|
||||||
|
test suite","website":null},"account":{"id":"1234567890123456","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":true,"bot":false,"discoverable":null,"group":false,"created_at":"2022-06-24T00:00:00.000Z","note":"","url":"http://localhost/@mastodonpy_test","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":1,"last_status_at":"2022-06-24","emojis":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null}]'
|
||||||
headers:
|
headers:
|
||||||
Cache-Control: ['no-cache, no-store']
|
Cache-Control:
|
||||||
Content-Type: [application/json; charset=utf-8]
|
- no-store
|
||||||
Referrer-Policy: [strict-origin-when-cross-origin]
|
Content-Security-Policy:
|
||||||
Transfer-Encoding: [chunked]
|
- 'base-uri ''none''; default-src ''none''; frame-ancestors ''none''; font-src
|
||||||
Vary: ['Accept-Encoding, Origin']
|
''self'' http://localhost; img-src ''self'' https: data: blob: http://localhost;
|
||||||
X-Content-Type-Options: [nosniff]
|
style-src ''self'' http://localhost ''nonce-wzGUumpjXwVRz6YQjB+AhQ==''; media-src
|
||||||
X-Download-Options: [noopen]
|
''self'' https: data: http://localhost; frame-src ''self'' https:; manifest-src
|
||||||
X-Frame-Options: [SAMEORIGIN]
|
''self'' http://localhost; connect-src ''self'' data: blob: http://localhost
|
||||||
X-Permitted-Cross-Domain-Policies: [none]
|
http://files.example.com ws://localhost:4000 ws://localhost:3035 http://localhost:3035;
|
||||||
X-Request-Id: [d9792c38-ab1e-46de-9737-704433ad8f94]
|
script-src ''self'' ''unsafe-inline'' ''unsafe-eval'' http://localhost; child-src
|
||||||
X-Runtime: ['0.095876']
|
''self'' blob: http://localhost; worker-src ''self'' blob: http://localhost'
|
||||||
X-XSS-Protection: [1; mode=block]
|
Content-Type:
|
||||||
content-length: ['1320']
|
- application/json; charset=utf-8
|
||||||
status: {code: 200, message: OK}
|
ETag:
|
||||||
|
- W/"e28cea671d77758e8cd2652347a030d1"
|
||||||
|
Link:
|
||||||
|
- <http://localhost:3000/api/v1/bookmarks?limit=1&max_id=11>; rel="next", <http://localhost:3000/api/v1/bookmarks?limit=1&min_id=11>;
|
||||||
|
rel="prev"
|
||||||
|
Referrer-Policy:
|
||||||
|
- strict-origin-when-cross-origin
|
||||||
|
Transfer-Encoding:
|
||||||
|
- chunked
|
||||||
|
Vary:
|
||||||
|
- Accept, Accept-Encoding, Origin
|
||||||
|
X-Content-Type-Options:
|
||||||
|
- nosniff
|
||||||
|
X-Download-Options:
|
||||||
|
- noopen
|
||||||
|
X-Frame-Options:
|
||||||
|
- SAMEORIGIN
|
||||||
|
X-Permitted-Cross-Domain-Policies:
|
||||||
|
- none
|
||||||
|
X-Request-Id:
|
||||||
|
- 7c887921-a7ee-478d-8e68-61359f4eacaf
|
||||||
|
X-Runtime:
|
||||||
|
- '0.037690'
|
||||||
|
X-XSS-Protection:
|
||||||
|
- 1; mode=block
|
||||||
|
content-length:
|
||||||
|
- '1309'
|
||||||
|
status:
|
||||||
|
code: 200
|
||||||
|
message: OK
|
||||||
- request:
|
- request:
|
||||||
body: null
|
body: null
|
||||||
headers:
|
headers:
|
||||||
Accept: ['*/*']
|
Accept:
|
||||||
Accept-Encoding: ['gzip, deflate']
|
- '*/*'
|
||||||
Authorization: [Bearer __MASTODON_PY_TEST_ACCESS_TOKEN]
|
Accept-Encoding:
|
||||||
Connection: [keep-alive]
|
- gzip, deflate
|
||||||
User-Agent: [python-requests/2.18.4]
|
Authorization:
|
||||||
|
- Bearer __MASTODON_PY_TEST_ACCESS_TOKEN
|
||||||
|
Connection:
|
||||||
|
- keep-alive
|
||||||
|
Content-Length:
|
||||||
|
- '0'
|
||||||
|
User-Agent:
|
||||||
|
- python-requests/2.22.0
|
||||||
|
method: POST
|
||||||
|
uri: http://localhost:3000/api/v1/statuses/108532515807337403/unbookmark
|
||||||
|
response:
|
||||||
|
body:
|
||||||
|
string: '{"id":"108532515807337403","created_at":"2022-06-24T12:46:05.129Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"public","language":"ja","uri":"http://localhost/users/mastodonpy_test/statuses/108532515807337403","url":"http://localhost/@mastodonpy_test/108532515807337403","replies_count":0,"reblogs_count":0,"favourites_count":0,"edited_at":null,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"pinned":false,"content":"\u003cp\u003eToot!\u003c/p\u003e","reblog":null,"application":{"name":"Mastodon.py
|
||||||
|
test suite","website":null},"account":{"id":"1234567890123456","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":true,"bot":false,"discoverable":null,"group":false,"created_at":"2022-06-24T00:00:00.000Z","note":"","url":"http://localhost/@mastodonpy_test","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":1,"last_status_at":"2022-06-24","emojis":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null}'
|
||||||
|
headers:
|
||||||
|
Cache-Control:
|
||||||
|
- no-store
|
||||||
|
Content-Security-Policy:
|
||||||
|
- 'base-uri ''none''; default-src ''none''; frame-ancestors ''none''; font-src
|
||||||
|
''self'' http://localhost; img-src ''self'' https: data: blob: http://localhost;
|
||||||
|
style-src ''self'' http://localhost ''nonce-x2CjCkxjnkvgJiPtS/CoIg==''; media-src
|
||||||
|
''self'' https: data: http://localhost; frame-src ''self'' https:; manifest-src
|
||||||
|
''self'' http://localhost; connect-src ''self'' data: blob: http://localhost
|
||||||
|
http://files.example.com ws://localhost:4000 ws://localhost:3035 http://localhost:3035;
|
||||||
|
script-src ''self'' ''unsafe-inline'' ''unsafe-eval'' http://localhost; child-src
|
||||||
|
''self'' blob: http://localhost; worker-src ''self'' blob: http://localhost'
|
||||||
|
Content-Type:
|
||||||
|
- application/json; charset=utf-8
|
||||||
|
ETag:
|
||||||
|
- W/"16c19c98c5667003bada6cc08d6a9efd"
|
||||||
|
Referrer-Policy:
|
||||||
|
- strict-origin-when-cross-origin
|
||||||
|
Transfer-Encoding:
|
||||||
|
- chunked
|
||||||
|
Vary:
|
||||||
|
- Accept, Accept-Encoding, Origin
|
||||||
|
X-Content-Type-Options:
|
||||||
|
- nosniff
|
||||||
|
X-Download-Options:
|
||||||
|
- noopen
|
||||||
|
X-Frame-Options:
|
||||||
|
- SAMEORIGIN
|
||||||
|
X-Permitted-Cross-Domain-Policies:
|
||||||
|
- none
|
||||||
|
X-Request-Id:
|
||||||
|
- 61142a88-6453-47c6-8230-6b6196efb64c
|
||||||
|
X-Runtime:
|
||||||
|
- '0.035340'
|
||||||
|
X-XSS-Protection:
|
||||||
|
- 1; mode=block
|
||||||
|
content-length:
|
||||||
|
- '1308'
|
||||||
|
status:
|
||||||
|
code: 200
|
||||||
|
message: OK
|
||||||
|
- request:
|
||||||
|
body: null
|
||||||
|
headers:
|
||||||
|
Accept:
|
||||||
|
- '*/*'
|
||||||
|
Accept-Encoding:
|
||||||
|
- gzip, deflate
|
||||||
|
Authorization:
|
||||||
|
- Bearer __MASTODON_PY_TEST_ACCESS_TOKEN
|
||||||
|
Connection:
|
||||||
|
- keep-alive
|
||||||
|
User-Agent:
|
||||||
|
- python-requests/2.22.0
|
||||||
method: GET
|
method: GET
|
||||||
uri: http://localhost:3000/api/v1/bookmarks
|
uri: http://localhost:3000/api/v1/bookmarks
|
||||||
response:
|
response:
|
||||||
body: {string: '[]'}
|
body:
|
||||||
|
string: '[]'
|
||||||
headers:
|
headers:
|
||||||
Cache-Control: ['no-cache, no-store']
|
Cache-Control:
|
||||||
Content-Type: [application/json; charset=utf-8]
|
- no-store
|
||||||
Referrer-Policy: [strict-origin-when-cross-origin]
|
Content-Security-Policy:
|
||||||
Transfer-Encoding: [chunked]
|
- 'base-uri ''none''; default-src ''none''; frame-ancestors ''none''; font-src
|
||||||
Vary: ['Accept-Encoding, Origin']
|
''self'' http://localhost; img-src ''self'' https: data: blob: http://localhost;
|
||||||
X-Content-Type-Options: [nosniff]
|
style-src ''self'' http://localhost ''nonce-i6oSjmQ5IE8wtOR+vDrGZw==''; media-src
|
||||||
X-Download-Options: [noopen]
|
''self'' https: data: http://localhost; frame-src ''self'' https:; manifest-src
|
||||||
X-Frame-Options: [SAMEORIGIN]
|
''self'' http://localhost; connect-src ''self'' data: blob: http://localhost
|
||||||
X-Permitted-Cross-Domain-Policies: [none]
|
http://files.example.com ws://localhost:4000 ws://localhost:3035 http://localhost:3035;
|
||||||
X-Request-Id: [8454c5ef-5f23-43b9-89d8-dc1b1605f7ac]
|
script-src ''self'' ''unsafe-inline'' ''unsafe-eval'' http://localhost; child-src
|
||||||
X-Runtime: ['0.035375']
|
''self'' blob: http://localhost; worker-src ''self'' blob: http://localhost'
|
||||||
X-XSS-Protection: [1; mode=block]
|
Content-Type:
|
||||||
content-length: ['2']
|
- application/json; charset=utf-8
|
||||||
status: {code: 200, message: OK}
|
ETag:
|
||||||
|
- W/"aaa12070e167024a89ca985596a44579"
|
||||||
|
Referrer-Policy:
|
||||||
|
- strict-origin-when-cross-origin
|
||||||
|
Transfer-Encoding:
|
||||||
|
- chunked
|
||||||
|
Vary:
|
||||||
|
- Accept, Accept-Encoding, Origin
|
||||||
|
X-Content-Type-Options:
|
||||||
|
- nosniff
|
||||||
|
X-Download-Options:
|
||||||
|
- noopen
|
||||||
|
X-Frame-Options:
|
||||||
|
- SAMEORIGIN
|
||||||
|
X-Permitted-Cross-Domain-Policies:
|
||||||
|
- none
|
||||||
|
X-Request-Id:
|
||||||
|
- 639bbb25-65a5-44eb-a886-d7092f891ecb
|
||||||
|
X-Runtime:
|
||||||
|
- '0.014781'
|
||||||
|
X-XSS-Protection:
|
||||||
|
- 1; mode=block
|
||||||
|
content-length:
|
||||||
|
- '2'
|
||||||
|
status:
|
||||||
|
code: 200
|
||||||
|
message: OK
|
||||||
- request:
|
- request:
|
||||||
body: null
|
body: null
|
||||||
headers:
|
headers:
|
||||||
Accept: ['*/*']
|
Accept:
|
||||||
Accept-Encoding: ['gzip, deflate']
|
- '*/*'
|
||||||
Authorization: [Bearer __MASTODON_PY_TEST_ACCESS_TOKEN]
|
Accept-Encoding:
|
||||||
Connection: [keep-alive]
|
- gzip, deflate
|
||||||
Content-Length: ['0']
|
Authorization:
|
||||||
User-Agent: [python-requests/2.18.4]
|
- Bearer __MASTODON_PY_TEST_ACCESS_TOKEN
|
||||||
|
Connection:
|
||||||
|
- keep-alive
|
||||||
|
Content-Length:
|
||||||
|
- '0'
|
||||||
|
User-Agent:
|
||||||
|
- python-requests/2.22.0
|
||||||
method: DELETE
|
method: DELETE
|
||||||
uri: http://localhost:3000/api/v1/statuses/103704183225122470
|
uri: http://localhost:3000/api/v1/statuses/108532515807337403
|
||||||
response:
|
response:
|
||||||
body: {string: '{"id":"103704183225122470","created_at":"2020-02-22T19:37:36.738Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"public","language":"ja","uri":"http://localhost/users/mastodonpy_test/statuses/103704183225122470","url":"http://localhost/@mastodonpy_test/103704183225122470","replies_count":0,"reblogs_count":0,"favourites_count":0,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"pinned":false,"text":"Toot!","reblog":null,"application":{"name":"Mastodon.py
|
body:
|
||||||
test suite","website":null},"account":{"id":"1234567890123456","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":false,"bot":false,"discoverable":false,"group":false,"created_at":"2020-02-22T20:26:54.402Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@mastodonpy_test","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":3,"last_status_at":"2020-02-22","emojis":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null}'}
|
string: '{"id":"108532515807337403","created_at":"2022-06-24T12:46:05.129Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"public","language":"ja","uri":"http://localhost/users/mastodonpy_test/statuses/108532515807337403","url":"http://localhost/@mastodonpy_test/108532515807337403","replies_count":0,"reblogs_count":0,"favourites_count":0,"edited_at":null,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"pinned":false,"text":"Toot!","reblog":null,"application":{"name":"Mastodon.py
|
||||||
|
test suite","website":null},"account":{"id":"1234567890123456","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":true,"bot":false,"discoverable":null,"group":false,"created_at":"2022-06-24T00:00:00.000Z","note":"","url":"http://localhost/@mastodonpy_test","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":0,"last_status_at":"2022-06-24","emojis":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null}'
|
||||||
headers:
|
headers:
|
||||||
Cache-Control: ['no-cache, no-store']
|
Cache-Control:
|
||||||
Content-Type: [application/json; charset=utf-8]
|
- no-store
|
||||||
Referrer-Policy: [strict-origin-when-cross-origin]
|
Content-Security-Policy:
|
||||||
Transfer-Encoding: [chunked]
|
- 'base-uri ''none''; default-src ''none''; frame-ancestors ''none''; font-src
|
||||||
Vary: ['Accept-Encoding, Origin']
|
''self'' http://localhost; img-src ''self'' https: data: blob: http://localhost;
|
||||||
X-Content-Type-Options: [nosniff]
|
style-src ''self'' http://localhost ''nonce-9ZHC6oHcDEPPkskChbQjOQ==''; media-src
|
||||||
X-Download-Options: [noopen]
|
''self'' https: data: http://localhost; frame-src ''self'' https:; manifest-src
|
||||||
X-Frame-Options: [SAMEORIGIN]
|
''self'' http://localhost; connect-src ''self'' data: blob: http://localhost
|
||||||
X-Permitted-Cross-Domain-Policies: [none]
|
http://files.example.com ws://localhost:4000 ws://localhost:3035 http://localhost:3035;
|
||||||
X-Request-Id: [c222a2ef-6671-4d1c-97be-0a4e2b2f6a14]
|
script-src ''self'' ''unsafe-inline'' ''unsafe-eval'' http://localhost; child-src
|
||||||
X-Runtime: ['0.122283']
|
''self'' blob: http://localhost; worker-src ''self'' blob: http://localhost'
|
||||||
X-XSS-Protection: [1; mode=block]
|
Content-Type:
|
||||||
content-length: ['1290']
|
- application/json; charset=utf-8
|
||||||
status: {code: 200, message: OK}
|
ETag:
|
||||||
|
- W/"efc9742f5a2c445d981fd8b15ed77122"
|
||||||
|
Referrer-Policy:
|
||||||
|
- strict-origin-when-cross-origin
|
||||||
|
Transfer-Encoding:
|
||||||
|
- chunked
|
||||||
|
Vary:
|
||||||
|
- Accept, Accept-Encoding, Origin
|
||||||
|
X-Content-Type-Options:
|
||||||
|
- nosniff
|
||||||
|
X-Download-Options:
|
||||||
|
- noopen
|
||||||
|
X-Frame-Options:
|
||||||
|
- SAMEORIGIN
|
||||||
|
X-Permitted-Cross-Domain-Policies:
|
||||||
|
- none
|
||||||
|
X-Request-Id:
|
||||||
|
- 1ca08d80-70b4-4aa9-abfe-5ca3286f63b8
|
||||||
|
X-Runtime:
|
||||||
|
- '0.037653'
|
||||||
|
X-XSS-Protection:
|
||||||
|
- 1; mode=block
|
||||||
|
content-length:
|
||||||
|
- '1278'
|
||||||
|
status:
|
||||||
|
code: 200
|
||||||
|
message: OK
|
||||||
version: 1
|
version: 1
|
||||||
|
|
|
@ -10,10 +10,13 @@ interactions:
|
||||||
method: GET
|
method: GET
|
||||||
uri: http://localhost:3000/api/v1/domain_blocks
|
uri: http://localhost:3000/api/v1/domain_blocks
|
||||||
response:
|
response:
|
||||||
body: {string: '[]'}
|
body: {string: '["example.com"]'}
|
||||||
headers:
|
headers:
|
||||||
Cache-Control: ['no-cache, no-store']
|
Cache-Control: ['no-cache, no-store']
|
||||||
Content-Type: [application/json; charset=utf-8]
|
Content-Type: [application/json; charset=utf-8]
|
||||||
|
Link: ['<http://localhost:3000/api/v1/domain_blocks?max_id=10023>;
|
||||||
|
rel="next", <http://localhost:3000/api/v1/domain_blocks?min_id=10021>;
|
||||||
|
rel="prev"']
|
||||||
Referrer-Policy: [strict-origin-when-cross-origin]
|
Referrer-Policy: [strict-origin-when-cross-origin]
|
||||||
Transfer-Encoding: [chunked]
|
Transfer-Encoding: [chunked]
|
||||||
Vary: ['Accept-Encoding, Origin']
|
Vary: ['Accept-Encoding, Origin']
|
||||||
|
@ -24,6 +27,6 @@ interactions:
|
||||||
X-Request-Id: [79ec8c37-a374-47e4-a698-a8b8511ca20f]
|
X-Request-Id: [79ec8c37-a374-47e4-a698-a8b8511ca20f]
|
||||||
X-Runtime: ['0.098492']
|
X-Runtime: ['0.098492']
|
||||||
X-XSS-Protection: [1; mode=block]
|
X-XSS-Protection: [1; mode=block]
|
||||||
content-length: ['2']
|
content-length: ['15']
|
||||||
status: {code: 200, message: OK}
|
status: {code: 200, message: OK}
|
||||||
version: 1
|
version: 1
|
||||||
|
|
|
@ -0,0 +1,749 @@
|
||||||
|
interactions:
|
||||||
|
- request:
|
||||||
|
body: null
|
||||||
|
headers:
|
||||||
|
Accept: ['*/*']
|
||||||
|
Accept-Encoding: ['gzip, deflate']
|
||||||
|
Authorization: [Bearer __MASTODON_PY_TEST_ACCESS_TOKEN]
|
||||||
|
Connection: [keep-alive]
|
||||||
|
User-Agent: [python-requests/2.18.4]
|
||||||
|
method: GET
|
||||||
|
uri: http://localhost:3000/api/v1/accounts/verify_credentials
|
||||||
|
response:
|
||||||
|
body: {string: '{"id":"1234567890123456","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":false,"bot":false,"discoverable":false,"group":false,"created_at":"2020-02-22T20:26:54.402Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@mastodonpy_test","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":1,"last_status_at":"2020-02-22","source":{"privacy":"public","sensitive":false,"language":null,"note":"","fields":[],"follow_requests_count":0},"emojis":[],"fields":[]}'}
|
||||||
|
headers:
|
||||||
|
Cache-Control: ['no-cache, no-store']
|
||||||
|
Content-Type: [application/json; charset=utf-8]
|
||||||
|
Referrer-Policy: [strict-origin-when-cross-origin]
|
||||||
|
Transfer-Encoding: [chunked]
|
||||||
|
Vary: ['Accept-Encoding, Origin']
|
||||||
|
X-Content-Type-Options: [nosniff]
|
||||||
|
X-Download-Options: [noopen]
|
||||||
|
X-Frame-Options: [SAMEORIGIN]
|
||||||
|
X-Permitted-Cross-Domain-Policies: [none]
|
||||||
|
X-Request-Id: [ae32b16c-712a-4109-88b9-392036a21925]
|
||||||
|
X-Runtime: ['0.651439']
|
||||||
|
X-XSS-Protection: [1; mode=block]
|
||||||
|
content-length: ['745']
|
||||||
|
status: {code: 200, message: OK}
|
||||||
|
- request:
|
||||||
|
body: status=Toot+number+0%21
|
||||||
|
headers:
|
||||||
|
Accept: ['*/*']
|
||||||
|
Accept-Encoding: ['gzip, deflate']
|
||||||
|
Authorization: [Bearer __MASTODON_PY_TEST_ACCESS_TOKEN]
|
||||||
|
Connection: [keep-alive]
|
||||||
|
Content-Length: ['23']
|
||||||
|
Content-Type: [application/x-www-form-urlencoded]
|
||||||
|
User-Agent: [python-requests/2.18.4]
|
||||||
|
method: POST
|
||||||
|
uri: http://localhost:3000/api/v1/statuses
|
||||||
|
response:
|
||||||
|
body: {string: '{"id":"103704149189751466","created_at":"2020-02-22T19:28:57.717Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"public","language":"ja","uri":"http://localhost/users/mastodonpy_test/statuses/103704149189751466","url":"http://localhost/@mastodonpy_test/103704149189751466","replies_count":0,"reblogs_count":0,"favourites_count":0,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"pinned":false,"content":"\u003cp\u003eToot
|
||||||
|
number 0!\u003c/p\u003e","reblog":null,"application":{"name":"Mastodon.py
|
||||||
|
test suite","website":null},"account":{"id":"1234567890123456","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":false,"bot":false,"discoverable":false,"group":false,"created_at":"2020-02-22T20:26:54.402Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@mastodonpy_test","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":2,"last_status_at":"2020-02-22","emojis":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null}'}
|
||||||
|
headers:
|
||||||
|
Cache-Control: ['no-cache, no-store']
|
||||||
|
Content-Type: [application/json; charset=utf-8]
|
||||||
|
Referrer-Policy: [strict-origin-when-cross-origin]
|
||||||
|
Transfer-Encoding: [chunked]
|
||||||
|
Vary: ['Accept-Encoding, Origin']
|
||||||
|
X-Content-Type-Options: [nosniff]
|
||||||
|
X-Download-Options: [noopen]
|
||||||
|
X-Frame-Options: [SAMEORIGIN]
|
||||||
|
X-Permitted-Cross-Domain-Policies: [none]
|
||||||
|
X-Request-Id: [f17c9f1b-ccda-4ffb-8677-931a2bcd778b]
|
||||||
|
X-Runtime: ['0.801649']
|
||||||
|
X-XSS-Protection: [1; mode=block]
|
||||||
|
content-length: ['1329']
|
||||||
|
status: {code: 200, message: OK}
|
||||||
|
- request:
|
||||||
|
body: status=Toot+number+1%21
|
||||||
|
headers:
|
||||||
|
Accept: ['*/*']
|
||||||
|
Accept-Encoding: ['gzip, deflate']
|
||||||
|
Authorization: [Bearer __MASTODON_PY_TEST_ACCESS_TOKEN]
|
||||||
|
Connection: [keep-alive]
|
||||||
|
Content-Length: ['23']
|
||||||
|
Content-Type: [application/x-www-form-urlencoded]
|
||||||
|
User-Agent: [python-requests/2.18.4]
|
||||||
|
method: POST
|
||||||
|
uri: http://localhost:3000/api/v1/statuses
|
||||||
|
response:
|
||||||
|
body: {string: '{"id":"103704149240204204","created_at":"2020-02-22T19:28:58.181Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"public","language":"ja","uri":"http://localhost/users/mastodonpy_test/statuses/103704149240204204","url":"http://localhost/@mastodonpy_test/103704149240204204","replies_count":0,"reblogs_count":0,"favourites_count":0,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"pinned":false,"content":"\u003cp\u003eToot
|
||||||
|
number 1!\u003c/p\u003e","reblog":null,"application":{"name":"Mastodon.py
|
||||||
|
test suite","website":null},"account":{"id":"1234567890123456","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":false,"bot":false,"discoverable":false,"group":false,"created_at":"2020-02-22T20:26:54.402Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@mastodonpy_test","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":3,"last_status_at":"2020-02-22","emojis":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null}'}
|
||||||
|
headers:
|
||||||
|
Cache-Control: ['no-cache, no-store']
|
||||||
|
Content-Type: [application/json; charset=utf-8]
|
||||||
|
Referrer-Policy: [strict-origin-when-cross-origin]
|
||||||
|
Transfer-Encoding: [chunked]
|
||||||
|
Vary: ['Accept-Encoding, Origin']
|
||||||
|
X-Content-Type-Options: [nosniff]
|
||||||
|
X-Download-Options: [noopen]
|
||||||
|
X-Frame-Options: [SAMEORIGIN]
|
||||||
|
X-Permitted-Cross-Domain-Policies: [none]
|
||||||
|
X-Request-Id: [d3af53b9-a9f0-41ce-b0c4-1a69b7e7f18a]
|
||||||
|
X-Runtime: ['0.211565']
|
||||||
|
X-XSS-Protection: [1; mode=block]
|
||||||
|
content-length: ['1329']
|
||||||
|
status: {code: 200, message: OK}
|
||||||
|
- request:
|
||||||
|
body: status=Toot+number+2%21
|
||||||
|
headers:
|
||||||
|
Accept: ['*/*']
|
||||||
|
Accept-Encoding: ['gzip, deflate']
|
||||||
|
Authorization: [Bearer __MASTODON_PY_TEST_ACCESS_TOKEN]
|
||||||
|
Connection: [keep-alive]
|
||||||
|
Content-Length: ['23']
|
||||||
|
Content-Type: [application/x-www-form-urlencoded]
|
||||||
|
User-Agent: [python-requests/2.18.4]
|
||||||
|
method: POST
|
||||||
|
uri: http://localhost:3000/api/v1/statuses
|
||||||
|
response:
|
||||||
|
body: {string: '{"id":"103704149255716248","created_at":"2020-02-22T19:28:58.413Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"public","language":"ja","uri":"http://localhost/users/mastodonpy_test/statuses/103704149255716248","url":"http://localhost/@mastodonpy_test/103704149255716248","replies_count":0,"reblogs_count":0,"favourites_count":0,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"pinned":false,"content":"\u003cp\u003eToot
|
||||||
|
number 2!\u003c/p\u003e","reblog":null,"application":{"name":"Mastodon.py
|
||||||
|
test suite","website":null},"account":{"id":"1234567890123456","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":false,"bot":false,"discoverable":false,"group":false,"created_at":"2020-02-22T20:26:54.402Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@mastodonpy_test","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":4,"last_status_at":"2020-02-22","emojis":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null}'}
|
||||||
|
headers:
|
||||||
|
Cache-Control: ['no-cache, no-store']
|
||||||
|
Content-Type: [application/json; charset=utf-8]
|
||||||
|
Referrer-Policy: [strict-origin-when-cross-origin]
|
||||||
|
Transfer-Encoding: [chunked]
|
||||||
|
Vary: ['Accept-Encoding, Origin']
|
||||||
|
X-Content-Type-Options: [nosniff]
|
||||||
|
X-Download-Options: [noopen]
|
||||||
|
X-Frame-Options: [SAMEORIGIN]
|
||||||
|
X-Permitted-Cross-Domain-Policies: [none]
|
||||||
|
X-Request-Id: [dc3327da-8fc5-46c6-8759-8953392d450d]
|
||||||
|
X-Runtime: ['0.211682']
|
||||||
|
X-XSS-Protection: [1; mode=block]
|
||||||
|
content-length: ['1329']
|
||||||
|
status: {code: 200, message: OK}
|
||||||
|
- request:
|
||||||
|
body: status=Toot+number+3%21
|
||||||
|
headers:
|
||||||
|
Accept: ['*/*']
|
||||||
|
Accept-Encoding: ['gzip, deflate']
|
||||||
|
Authorization: [Bearer __MASTODON_PY_TEST_ACCESS_TOKEN]
|
||||||
|
Connection: [keep-alive]
|
||||||
|
Content-Length: ['23']
|
||||||
|
Content-Type: [application/x-www-form-urlencoded]
|
||||||
|
User-Agent: [python-requests/2.18.4]
|
||||||
|
method: POST
|
||||||
|
uri: http://localhost:3000/api/v1/statuses
|
||||||
|
response:
|
||||||
|
body: {string: '{"id":"103704149270849591","created_at":"2020-02-22T19:28:58.643Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"public","language":"ja","uri":"http://localhost/users/mastodonpy_test/statuses/103704149270849591","url":"http://localhost/@mastodonpy_test/103704149270849591","replies_count":0,"reblogs_count":0,"favourites_count":0,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"pinned":false,"content":"\u003cp\u003eToot
|
||||||
|
number 3!\u003c/p\u003e","reblog":null,"application":{"name":"Mastodon.py
|
||||||
|
test suite","website":null},"account":{"id":"1234567890123456","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":false,"bot":false,"discoverable":false,"group":false,"created_at":"2020-02-22T20:26:54.402Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@mastodonpy_test","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":5,"last_status_at":"2020-02-22","emojis":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null}'}
|
||||||
|
headers:
|
||||||
|
Cache-Control: ['no-cache, no-store']
|
||||||
|
Content-Type: [application/json; charset=utf-8]
|
||||||
|
Referrer-Policy: [strict-origin-when-cross-origin]
|
||||||
|
Transfer-Encoding: [chunked]
|
||||||
|
Vary: ['Accept-Encoding, Origin']
|
||||||
|
X-Content-Type-Options: [nosniff]
|
||||||
|
X-Download-Options: [noopen]
|
||||||
|
X-Frame-Options: [SAMEORIGIN]
|
||||||
|
X-Permitted-Cross-Domain-Policies: [none]
|
||||||
|
X-Request-Id: [3b34502f-358b-4f69-a8a7-b72cee3056a0]
|
||||||
|
X-Runtime: ['0.205497']
|
||||||
|
X-XSS-Protection: [1; mode=block]
|
||||||
|
content-length: ['1329']
|
||||||
|
status: {code: 200, message: OK}
|
||||||
|
- request:
|
||||||
|
body: status=Toot+number+4%21
|
||||||
|
headers:
|
||||||
|
Accept: ['*/*']
|
||||||
|
Accept-Encoding: ['gzip, deflate']
|
||||||
|
Authorization: [Bearer __MASTODON_PY_TEST_ACCESS_TOKEN]
|
||||||
|
Connection: [keep-alive]
|
||||||
|
Content-Length: ['23']
|
||||||
|
Content-Type: [application/x-www-form-urlencoded]
|
||||||
|
User-Agent: [python-requests/2.18.4]
|
||||||
|
method: POST
|
||||||
|
uri: http://localhost:3000/api/v1/statuses
|
||||||
|
response:
|
||||||
|
body: {string: '{"id":"103704149285153724","created_at":"2020-02-22T19:28:58.863Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"public","language":"ja","uri":"http://localhost/users/mastodonpy_test/statuses/103704149285153724","url":"http://localhost/@mastodonpy_test/103704149285153724","replies_count":0,"reblogs_count":0,"favourites_count":0,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"pinned":false,"content":"\u003cp\u003eToot
|
||||||
|
number 4!\u003c/p\u003e","reblog":null,"application":{"name":"Mastodon.py
|
||||||
|
test suite","website":null},"account":{"id":"1234567890123456","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":false,"bot":false,"discoverable":false,"group":false,"created_at":"2020-02-22T20:26:54.402Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@mastodonpy_test","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":6,"last_status_at":"2020-02-22","emojis":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null}'}
|
||||||
|
headers:
|
||||||
|
Cache-Control: ['no-cache, no-store']
|
||||||
|
Content-Type: [application/json; charset=utf-8]
|
||||||
|
Referrer-Policy: [strict-origin-when-cross-origin]
|
||||||
|
Transfer-Encoding: [chunked]
|
||||||
|
Vary: ['Accept-Encoding, Origin']
|
||||||
|
X-Content-Type-Options: [nosniff]
|
||||||
|
X-Download-Options: [noopen]
|
||||||
|
X-Frame-Options: [SAMEORIGIN]
|
||||||
|
X-Permitted-Cross-Domain-Policies: [none]
|
||||||
|
X-Request-Id: [49cc87eb-ae66-4bbb-8fca-79277c82b4b6]
|
||||||
|
X-Runtime: ['0.214698']
|
||||||
|
X-XSS-Protection: [1; mode=block]
|
||||||
|
content-length: ['1329']
|
||||||
|
status: {code: 200, message: OK}
|
||||||
|
- request:
|
||||||
|
body: status=Toot+number+5%21
|
||||||
|
headers:
|
||||||
|
Accept: ['*/*']
|
||||||
|
Accept-Encoding: ['gzip, deflate']
|
||||||
|
Authorization: [Bearer __MASTODON_PY_TEST_ACCESS_TOKEN]
|
||||||
|
Connection: [keep-alive]
|
||||||
|
Content-Length: ['23']
|
||||||
|
Content-Type: [application/x-www-form-urlencoded]
|
||||||
|
User-Agent: [python-requests/2.18.4]
|
||||||
|
method: POST
|
||||||
|
uri: http://localhost:3000/api/v1/statuses
|
||||||
|
response:
|
||||||
|
body: {string: '{"id":"103704149300069225","created_at":"2020-02-22T19:28:59.095Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"public","language":"ja","uri":"http://localhost/users/mastodonpy_test/statuses/103704149300069225","url":"http://localhost/@mastodonpy_test/103704149300069225","replies_count":0,"reblogs_count":0,"favourites_count":0,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"pinned":false,"content":"\u003cp\u003eToot
|
||||||
|
number 5!\u003c/p\u003e","reblog":null,"application":{"name":"Mastodon.py
|
||||||
|
test suite","website":null},"account":{"id":"1234567890123456","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":false,"bot":false,"discoverable":false,"group":false,"created_at":"2020-02-22T20:26:54.402Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@mastodonpy_test","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":7,"last_status_at":"2020-02-22","emojis":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null}'}
|
||||||
|
headers:
|
||||||
|
Cache-Control: ['no-cache, no-store']
|
||||||
|
Content-Type: [application/json; charset=utf-8]
|
||||||
|
Referrer-Policy: [strict-origin-when-cross-origin]
|
||||||
|
Transfer-Encoding: [chunked]
|
||||||
|
Vary: ['Accept-Encoding, Origin']
|
||||||
|
X-Content-Type-Options: [nosniff]
|
||||||
|
X-Download-Options: [noopen]
|
||||||
|
X-Frame-Options: [SAMEORIGIN]
|
||||||
|
X-Permitted-Cross-Domain-Policies: [none]
|
||||||
|
X-Request-Id: [c0aed740-e674-4ca5-8e98-f4cba0044418]
|
||||||
|
X-Runtime: ['0.225727']
|
||||||
|
X-XSS-Protection: [1; mode=block]
|
||||||
|
content-length: ['1329']
|
||||||
|
status: {code: 200, message: OK}
|
||||||
|
- request:
|
||||||
|
body: status=Toot+number+6%21
|
||||||
|
headers:
|
||||||
|
Accept: ['*/*']
|
||||||
|
Accept-Encoding: ['gzip, deflate']
|
||||||
|
Authorization: [Bearer __MASTODON_PY_TEST_ACCESS_TOKEN]
|
||||||
|
Connection: [keep-alive]
|
||||||
|
Content-Length: ['23']
|
||||||
|
Content-Type: [application/x-www-form-urlencoded]
|
||||||
|
User-Agent: [python-requests/2.18.4]
|
||||||
|
method: POST
|
||||||
|
uri: http://localhost:3000/api/v1/statuses
|
||||||
|
response:
|
||||||
|
body: {string: '{"id":"103704149316561035","created_at":"2020-02-22T19:28:59.341Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"public","language":"ja","uri":"http://localhost/users/mastodonpy_test/statuses/103704149316561035","url":"http://localhost/@mastodonpy_test/103704149316561035","replies_count":0,"reblogs_count":0,"favourites_count":0,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"pinned":false,"content":"\u003cp\u003eToot
|
||||||
|
number 6!\u003c/p\u003e","reblog":null,"application":{"name":"Mastodon.py
|
||||||
|
test suite","website":null},"account":{"id":"1234567890123456","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":false,"bot":false,"discoverable":false,"group":false,"created_at":"2020-02-22T20:26:54.402Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@mastodonpy_test","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":8,"last_status_at":"2020-02-22","emojis":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null}'}
|
||||||
|
headers:
|
||||||
|
Cache-Control: ['no-cache, no-store']
|
||||||
|
Content-Type: [application/json; charset=utf-8]
|
||||||
|
Referrer-Policy: [strict-origin-when-cross-origin]
|
||||||
|
Transfer-Encoding: [chunked]
|
||||||
|
Vary: ['Accept-Encoding, Origin']
|
||||||
|
X-Content-Type-Options: [nosniff]
|
||||||
|
X-Download-Options: [noopen]
|
||||||
|
X-Frame-Options: [SAMEORIGIN]
|
||||||
|
X-Permitted-Cross-Domain-Policies: [none]
|
||||||
|
X-Request-Id: [93854c13-4b4c-420e-a825-c65efae49785]
|
||||||
|
X-Runtime: ['0.251071']
|
||||||
|
X-XSS-Protection: [1; mode=block]
|
||||||
|
content-length: ['1329']
|
||||||
|
status: {code: 200, message: OK}
|
||||||
|
- request:
|
||||||
|
body: status=Toot+number+7%21
|
||||||
|
headers:
|
||||||
|
Accept: ['*/*']
|
||||||
|
Accept-Encoding: ['gzip, deflate']
|
||||||
|
Authorization: [Bearer __MASTODON_PY_TEST_ACCESS_TOKEN]
|
||||||
|
Connection: [keep-alive]
|
||||||
|
Content-Length: ['23']
|
||||||
|
Content-Type: [application/x-www-form-urlencoded]
|
||||||
|
User-Agent: [python-requests/2.18.4]
|
||||||
|
method: POST
|
||||||
|
uri: http://localhost:3000/api/v1/statuses
|
||||||
|
response:
|
||||||
|
body: {string: '{"id":"103704149334172751","created_at":"2020-02-22T19:28:59.612Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"public","language":"ja","uri":"http://localhost/users/mastodonpy_test/statuses/103704149334172751","url":"http://localhost/@mastodonpy_test/103704149334172751","replies_count":0,"reblogs_count":0,"favourites_count":0,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"pinned":false,"content":"\u003cp\u003eToot
|
||||||
|
number 7!\u003c/p\u003e","reblog":null,"application":{"name":"Mastodon.py
|
||||||
|
test suite","website":null},"account":{"id":"1234567890123456","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":false,"bot":false,"discoverable":false,"group":false,"created_at":"2020-02-22T20:26:54.402Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@mastodonpy_test","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":9,"last_status_at":"2020-02-22","emojis":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null}'}
|
||||||
|
headers:
|
||||||
|
Cache-Control: ['no-cache, no-store']
|
||||||
|
Content-Type: [application/json; charset=utf-8]
|
||||||
|
Referrer-Policy: [strict-origin-when-cross-origin]
|
||||||
|
Transfer-Encoding: [chunked]
|
||||||
|
Vary: ['Accept-Encoding, Origin']
|
||||||
|
X-Content-Type-Options: [nosniff]
|
||||||
|
X-Download-Options: [noopen]
|
||||||
|
X-Frame-Options: [SAMEORIGIN]
|
||||||
|
X-Permitted-Cross-Domain-Policies: [none]
|
||||||
|
X-Request-Id: [31c48d09-3509-4a99-ba24-5c08cc689296]
|
||||||
|
X-Runtime: ['0.203192']
|
||||||
|
X-XSS-Protection: [1; mode=block]
|
||||||
|
content-length: ['1329']
|
||||||
|
status: {code: 200, message: OK}
|
||||||
|
- request:
|
||||||
|
body: status=Toot+number+8%21
|
||||||
|
headers:
|
||||||
|
Accept: ['*/*']
|
||||||
|
Accept-Encoding: ['gzip, deflate']
|
||||||
|
Authorization: [Bearer __MASTODON_PY_TEST_ACCESS_TOKEN]
|
||||||
|
Connection: [keep-alive]
|
||||||
|
Content-Length: ['23']
|
||||||
|
Content-Type: [application/x-www-form-urlencoded]
|
||||||
|
User-Agent: [python-requests/2.18.4]
|
||||||
|
method: POST
|
||||||
|
uri: http://localhost:3000/api/v1/statuses
|
||||||
|
response:
|
||||||
|
body: {string: '{"id":"103704149348344165","created_at":"2020-02-22T19:28:59.827Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"public","language":"ja","uri":"http://localhost/users/mastodonpy_test/statuses/103704149348344165","url":"http://localhost/@mastodonpy_test/103704149348344165","replies_count":0,"reblogs_count":0,"favourites_count":0,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"pinned":false,"content":"\u003cp\u003eToot
|
||||||
|
number 8!\u003c/p\u003e","reblog":null,"application":{"name":"Mastodon.py
|
||||||
|
test suite","website":null},"account":{"id":"1234567890123456","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":false,"bot":false,"discoverable":false,"group":false,"created_at":"2020-02-22T20:26:54.402Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@mastodonpy_test","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":10,"last_status_at":"2020-02-22","emojis":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null}'}
|
||||||
|
headers:
|
||||||
|
Cache-Control: ['no-cache, no-store']
|
||||||
|
Content-Type: [application/json; charset=utf-8]
|
||||||
|
Referrer-Policy: [strict-origin-when-cross-origin]
|
||||||
|
Transfer-Encoding: [chunked]
|
||||||
|
Vary: ['Accept-Encoding, Origin']
|
||||||
|
X-Content-Type-Options: [nosniff]
|
||||||
|
X-Download-Options: [noopen]
|
||||||
|
X-Frame-Options: [SAMEORIGIN]
|
||||||
|
X-Permitted-Cross-Domain-Policies: [none]
|
||||||
|
X-Request-Id: [24ce9bfd-9f86-4a6a-b889-998c58c137f2]
|
||||||
|
X-Runtime: ['0.223554']
|
||||||
|
X-XSS-Protection: [1; mode=block]
|
||||||
|
content-length: ['1330']
|
||||||
|
status: {code: 200, message: OK}
|
||||||
|
- request:
|
||||||
|
body: status=Toot+number+9%21
|
||||||
|
headers:
|
||||||
|
Accept: ['*/*']
|
||||||
|
Accept-Encoding: ['gzip, deflate']
|
||||||
|
Authorization: [Bearer __MASTODON_PY_TEST_ACCESS_TOKEN]
|
||||||
|
Connection: [keep-alive]
|
||||||
|
Content-Length: ['23']
|
||||||
|
Content-Type: [application/x-www-form-urlencoded]
|
||||||
|
User-Agent: [python-requests/2.18.4]
|
||||||
|
method: POST
|
||||||
|
uri: http://localhost:3000/api/v1/statuses
|
||||||
|
response:
|
||||||
|
body: {string: '{"id":"103704149365440398","created_at":"2020-02-22T19:29:00.089Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"public","language":"ja","uri":"http://localhost/users/mastodonpy_test/statuses/103704149365440398","url":"http://localhost/@mastodonpy_test/103704149365440398","replies_count":0,"reblogs_count":0,"favourites_count":0,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"pinned":false,"content":"\u003cp\u003eToot
|
||||||
|
number 9!\u003c/p\u003e","reblog":null,"application":{"name":"Mastodon.py
|
||||||
|
test suite","website":null},"account":{"id":"1234567890123456","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":false,"bot":false,"discoverable":false,"group":false,"created_at":"2020-02-22T20:26:54.402Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@mastodonpy_test","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":11,"last_status_at":"2020-02-22","emojis":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null}'}
|
||||||
|
headers:
|
||||||
|
Cache-Control: ['no-cache, no-store']
|
||||||
|
Content-Type: [application/json; charset=utf-8]
|
||||||
|
Referrer-Policy: [strict-origin-when-cross-origin]
|
||||||
|
Transfer-Encoding: [chunked]
|
||||||
|
Vary: ['Accept-Encoding, Origin']
|
||||||
|
X-Content-Type-Options: [nosniff]
|
||||||
|
X-Download-Options: [noopen]
|
||||||
|
X-Frame-Options: [SAMEORIGIN]
|
||||||
|
X-Permitted-Cross-Domain-Policies: [none]
|
||||||
|
X-Request-Id: [98577765-f52d-4994-a792-36c9eef95f62]
|
||||||
|
X-Runtime: ['0.228954']
|
||||||
|
X-XSS-Protection: [1; mode=block]
|
||||||
|
content-length: ['1330']
|
||||||
|
status: {code: 200, message: OK}
|
||||||
|
- request:
|
||||||
|
body: null
|
||||||
|
headers:
|
||||||
|
Accept: ['*/*']
|
||||||
|
Accept-Encoding: ['gzip, deflate']
|
||||||
|
Authorization: [Bearer __MASTODON_PY_TEST_ACCESS_TOKEN]
|
||||||
|
Connection: [keep-alive]
|
||||||
|
User-Agent: [python-requests/2.18.4]
|
||||||
|
method: GET
|
||||||
|
uri: http://localhost:3000/api/v1/accounts/1234567890123456/statuses?limit=5
|
||||||
|
response:
|
||||||
|
body: {string: '[{"id":"103704149365440398","created_at":"2020-02-22T19:29:00.089Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"public","language":"ja","uri":"http://localhost/users/mastodonpy_test/statuses/103704149365440398","url":"http://localhost/@mastodonpy_test/103704149365440398","replies_count":0,"reblogs_count":0,"favourites_count":0,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"pinned":false,"content":"\u003cp\u003eToot
|
||||||
|
number 9!\u003c/p\u003e","reblog":null,"application":{"name":"Mastodon.py
|
||||||
|
test suite","website":null},"account":{"id":"1234567890123456","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":false,"bot":false,"discoverable":false,"group":false,"created_at":"2020-02-22T20:26:54.402Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@mastodonpy_test","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":11,"last_status_at":"2020-02-22","emojis":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null},{"id":"103704149348344165","created_at":"2020-02-22T19:28:59.827Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"public","language":"ja","uri":"http://localhost/users/mastodonpy_test/statuses/103704149348344165","url":"http://localhost/@mastodonpy_test/103704149348344165","replies_count":0,"reblogs_count":0,"favourites_count":0,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"pinned":false,"content":"\u003cp\u003eToot
|
||||||
|
number 8!\u003c/p\u003e","reblog":null,"application":{"name":"Mastodon.py
|
||||||
|
test suite","website":null},"account":{"id":"1234567890123456","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":false,"bot":false,"discoverable":false,"group":false,"created_at":"2020-02-22T20:26:54.402Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@mastodonpy_test","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":11,"last_status_at":"2020-02-22","emojis":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null},{"id":"103704149334172751","created_at":"2020-02-22T19:28:59.612Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"public","language":"ja","uri":"http://localhost/users/mastodonpy_test/statuses/103704149334172751","url":"http://localhost/@mastodonpy_test/103704149334172751","replies_count":0,"reblogs_count":0,"favourites_count":0,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"pinned":false,"content":"\u003cp\u003eToot
|
||||||
|
number 7!\u003c/p\u003e","reblog":null,"application":{"name":"Mastodon.py
|
||||||
|
test suite","website":null},"account":{"id":"1234567890123456","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":false,"bot":false,"discoverable":false,"group":false,"created_at":"2020-02-22T20:26:54.402Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@mastodonpy_test","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":11,"last_status_at":"2020-02-22","emojis":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null},{"id":"103704149316561035","created_at":"2020-02-22T19:28:59.341Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"public","language":"ja","uri":"http://localhost/users/mastodonpy_test/statuses/103704149316561035","url":"http://localhost/@mastodonpy_test/103704149316561035","replies_count":0,"reblogs_count":0,"favourites_count":0,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"pinned":false,"content":"\u003cp\u003eToot
|
||||||
|
number 6!\u003c/p\u003e","reblog":null,"application":{"name":"Mastodon.py
|
||||||
|
test suite","website":null},"account":{"id":"1234567890123456","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":false,"bot":false,"discoverable":false,"group":false,"created_at":"2020-02-22T20:26:54.402Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@mastodonpy_test","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":11,"last_status_at":"2020-02-22","emojis":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null},{"id":"103704149300069225","created_at":"2020-02-22T19:28:59.095Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"public","language":"ja","uri":"http://localhost/users/mastodonpy_test/statuses/103704149300069225","url":"http://localhost/@mastodonpy_test/103704149300069225","replies_count":0,"reblogs_count":0,"favourites_count":0,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"pinned":false,"content":"\u003cp\u003eToot
|
||||||
|
number 5!\u003c/p\u003e","reblog":null,"application":{"name":"Mastodon.py
|
||||||
|
test suite","website":null},"account":{"id":"1234567890123456","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":false,"bot":false,"discoverable":false,"group":false,"created_at":"2020-02-22T20:26:54.402Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@mastodonpy_test","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":11,"last_status_at":"2020-02-22","emojis":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null}]'}
|
||||||
|
headers:
|
||||||
|
Cache-Control: ['no-cache, no-store']
|
||||||
|
Content-Type: [application/json; charset=utf-8]
|
||||||
|
Link: ['<http://localhost:3000/api/v1/accounts/1234567890123456/statuses?limit=5&max_id=103704149300069225>;
|
||||||
|
rel="next", <http://localhost:3000/api/v1/accounts/1234567890123456/statuses?limit=5&min_id=103704149365440398>;
|
||||||
|
rel="prev"']
|
||||||
|
Referrer-Policy: [strict-origin-when-cross-origin]
|
||||||
|
Transfer-Encoding: [chunked]
|
||||||
|
Vary: ['Accept-Encoding, Origin']
|
||||||
|
X-Content-Type-Options: [nosniff]
|
||||||
|
X-Download-Options: [noopen]
|
||||||
|
X-Frame-Options: [SAMEORIGIN]
|
||||||
|
X-Permitted-Cross-Domain-Policies: [none]
|
||||||
|
X-Request-Id: [4960311a-9e9a-4722-9417-5a34c30c805b]
|
||||||
|
X-Runtime: ['0.338488']
|
||||||
|
X-XSS-Protection: [1; mode=block]
|
||||||
|
content-length: ['6656']
|
||||||
|
status: {code: 200, message: OK}
|
||||||
|
- request:
|
||||||
|
body: null
|
||||||
|
headers:
|
||||||
|
Accept: ['*/*']
|
||||||
|
Accept-Encoding: ['gzip, deflate']
|
||||||
|
Authorization: [Bearer __MASTODON_PY_TEST_ACCESS_TOKEN]
|
||||||
|
Connection: [keep-alive]
|
||||||
|
User-Agent: [python-requests/2.18.4]
|
||||||
|
method: GET
|
||||||
|
uri: http://localhost:3000/api/v1/accounts/1234567890123456/statuses?limit=5&max_id=103704149300069225
|
||||||
|
response:
|
||||||
|
body: {string: '[{"id":"103704149285153724","created_at":"2020-02-22T19:28:58.863Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"public","language":"ja","uri":"http://localhost/users/mastodonpy_test/statuses/103704149285153724","url":"http://localhost/@mastodonpy_test/103704149285153724","replies_count":0,"reblogs_count":0,"favourites_count":0,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"pinned":false,"content":"\u003cp\u003eToot
|
||||||
|
number 4!\u003c/p\u003e","reblog":null,"application":{"name":"Mastodon.py
|
||||||
|
test suite","website":null},"account":{"id":"1234567890123456","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":false,"bot":false,"discoverable":false,"group":false,"created_at":"2020-02-22T20:26:54.402Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@mastodonpy_test","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":11,"last_status_at":"2020-02-22","emojis":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null},{"id":"103704149270849591","created_at":"2020-02-22T19:28:58.643Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"public","language":"ja","uri":"http://localhost/users/mastodonpy_test/statuses/103704149270849591","url":"http://localhost/@mastodonpy_test/103704149270849591","replies_count":0,"reblogs_count":0,"favourites_count":0,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"pinned":false,"content":"\u003cp\u003eToot
|
||||||
|
number 3!\u003c/p\u003e","reblog":null,"application":{"name":"Mastodon.py
|
||||||
|
test suite","website":null},"account":{"id":"1234567890123456","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":false,"bot":false,"discoverable":false,"group":false,"created_at":"2020-02-22T20:26:54.402Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@mastodonpy_test","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":11,"last_status_at":"2020-02-22","emojis":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null},{"id":"103704149255716248","created_at":"2020-02-22T19:28:58.413Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"public","language":"ja","uri":"http://localhost/users/mastodonpy_test/statuses/103704149255716248","url":"http://localhost/@mastodonpy_test/103704149255716248","replies_count":0,"reblogs_count":0,"favourites_count":0,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"pinned":false,"content":"\u003cp\u003eToot
|
||||||
|
number 2!\u003c/p\u003e","reblog":null,"application":{"name":"Mastodon.py
|
||||||
|
test suite","website":null},"account":{"id":"1234567890123456","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":false,"bot":false,"discoverable":false,"group":false,"created_at":"2020-02-22T20:26:54.402Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@mastodonpy_test","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":11,"last_status_at":"2020-02-22","emojis":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null},{"id":"103704149240204204","created_at":"2020-02-22T19:28:58.181Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"public","language":"ja","uri":"http://localhost/users/mastodonpy_test/statuses/103704149240204204","url":"http://localhost/@mastodonpy_test/103704149240204204","replies_count":0,"reblogs_count":0,"favourites_count":0,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"pinned":false,"content":"\u003cp\u003eToot
|
||||||
|
number 1!\u003c/p\u003e","reblog":null,"application":{"name":"Mastodon.py
|
||||||
|
test suite","website":null},"account":{"id":"1234567890123456","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":false,"bot":false,"discoverable":false,"group":false,"created_at":"2020-02-22T20:26:54.402Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@mastodonpy_test","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":11,"last_status_at":"2020-02-22","emojis":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null},{"id":"103704149189751466","created_at":"2020-02-22T19:28:57.717Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"public","language":"ja","uri":"http://localhost/users/mastodonpy_test/statuses/103704149189751466","url":"http://localhost/@mastodonpy_test/103704149189751466","replies_count":0,"reblogs_count":0,"favourites_count":0,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"pinned":false,"content":"\u003cp\u003eToot
|
||||||
|
number 0!\u003c/p\u003e","reblog":null,"application":{"name":"Mastodon.py
|
||||||
|
test suite","website":null},"account":{"id":"1234567890123456","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":false,"bot":false,"discoverable":false,"group":false,"created_at":"2020-02-22T20:26:54.402Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@mastodonpy_test","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":11,"last_status_at":"2020-02-22","emojis":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null}]'}
|
||||||
|
headers:
|
||||||
|
Cache-Control: ['no-cache, no-store']
|
||||||
|
Content-Type: [application/json; charset=utf-8]
|
||||||
|
Link: ['<http://localhost:3000/api/v1/accounts/1234567890123456/statuses?limit=5&max_id=103704149189751466>;
|
||||||
|
rel="next", <http://localhost:3000/api/v1/accounts/1234567890123456/statuses?limit=5&min_id=103704149285153724>;
|
||||||
|
rel="prev"']
|
||||||
|
Referrer-Policy: [strict-origin-when-cross-origin]
|
||||||
|
Transfer-Encoding: [chunked]
|
||||||
|
Vary: ['Accept-Encoding, Origin']
|
||||||
|
X-Content-Type-Options: [nosniff]
|
||||||
|
X-Download-Options: [noopen]
|
||||||
|
X-Frame-Options: [SAMEORIGIN]
|
||||||
|
X-Permitted-Cross-Domain-Policies: [none]
|
||||||
|
X-Request-Id: [aa025632-b316-43c0-afc5-243f62d2b6b8]
|
||||||
|
X-Runtime: ['0.201975']
|
||||||
|
X-XSS-Protection: [1; mode=block]
|
||||||
|
content-length: ['6656']
|
||||||
|
status: {code: 200, message: OK}
|
||||||
|
- request:
|
||||||
|
body: null
|
||||||
|
headers:
|
||||||
|
Accept: ['*/*']
|
||||||
|
Accept-Encoding: ['gzip, deflate']
|
||||||
|
Authorization: [Bearer __MASTODON_PY_TEST_ACCESS_TOKEN]
|
||||||
|
Connection: [keep-alive]
|
||||||
|
User-Agent: [python-requests/2.18.4]
|
||||||
|
method: GET
|
||||||
|
uri: http://localhost:3000/api/v1/accounts/1234567890123456/statuses?limit=5&min_id=103704149285153724
|
||||||
|
response:
|
||||||
|
body: {string: '[{"id":"103704149365440398","created_at":"2020-02-22T19:29:00.089Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"public","language":"ja","uri":"http://localhost/users/mastodonpy_test/statuses/103704149365440398","url":"http://localhost/@mastodonpy_test/103704149365440398","replies_count":0,"reblogs_count":0,"favourites_count":0,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"pinned":false,"content":"\u003cp\u003eToot
|
||||||
|
number 9!\u003c/p\u003e","reblog":null,"application":{"name":"Mastodon.py
|
||||||
|
test suite","website":null},"account":{"id":"1234567890123456","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":false,"bot":false,"discoverable":false,"group":false,"created_at":"2020-02-22T20:26:54.402Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@mastodonpy_test","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":11,"last_status_at":"2020-02-22","emojis":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null},{"id":"103704149348344165","created_at":"2020-02-22T19:28:59.827Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"public","language":"ja","uri":"http://localhost/users/mastodonpy_test/statuses/103704149348344165","url":"http://localhost/@mastodonpy_test/103704149348344165","replies_count":0,"reblogs_count":0,"favourites_count":0,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"pinned":false,"content":"\u003cp\u003eToot
|
||||||
|
number 8!\u003c/p\u003e","reblog":null,"application":{"name":"Mastodon.py
|
||||||
|
test suite","website":null},"account":{"id":"1234567890123456","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":false,"bot":false,"discoverable":false,"group":false,"created_at":"2020-02-22T20:26:54.402Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@mastodonpy_test","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":11,"last_status_at":"2020-02-22","emojis":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null},{"id":"103704149334172751","created_at":"2020-02-22T19:28:59.612Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"public","language":"ja","uri":"http://localhost/users/mastodonpy_test/statuses/103704149334172751","url":"http://localhost/@mastodonpy_test/103704149334172751","replies_count":0,"reblogs_count":0,"favourites_count":0,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"pinned":false,"content":"\u003cp\u003eToot
|
||||||
|
number 7!\u003c/p\u003e","reblog":null,"application":{"name":"Mastodon.py
|
||||||
|
test suite","website":null},"account":{"id":"1234567890123456","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":false,"bot":false,"discoverable":false,"group":false,"created_at":"2020-02-22T20:26:54.402Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@mastodonpy_test","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":11,"last_status_at":"2020-02-22","emojis":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null},{"id":"103704149316561035","created_at":"2020-02-22T19:28:59.341Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"public","language":"ja","uri":"http://localhost/users/mastodonpy_test/statuses/103704149316561035","url":"http://localhost/@mastodonpy_test/103704149316561035","replies_count":0,"reblogs_count":0,"favourites_count":0,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"pinned":false,"content":"\u003cp\u003eToot
|
||||||
|
number 6!\u003c/p\u003e","reblog":null,"application":{"name":"Mastodon.py
|
||||||
|
test suite","website":null},"account":{"id":"1234567890123456","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":false,"bot":false,"discoverable":false,"group":false,"created_at":"2020-02-22T20:26:54.402Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@mastodonpy_test","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":11,"last_status_at":"2020-02-22","emojis":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null},{"id":"103704149300069225","created_at":"2020-02-22T19:28:59.095Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"public","language":"ja","uri":"http://localhost/users/mastodonpy_test/statuses/103704149300069225","url":"http://localhost/@mastodonpy_test/103704149300069225","replies_count":0,"reblogs_count":0,"favourites_count":0,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"pinned":false,"content":"\u003cp\u003eToot
|
||||||
|
number 5!\u003c/p\u003e","reblog":null,"application":{"name":"Mastodon.py
|
||||||
|
test suite","website":null},"account":{"id":"1234567890123456","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":false,"bot":false,"discoverable":false,"group":false,"created_at":"2020-02-22T20:26:54.402Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@mastodonpy_test","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":11,"last_status_at":"2020-02-22","emojis":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null}]'}
|
||||||
|
headers:
|
||||||
|
Cache-Control: ['no-cache, no-store']
|
||||||
|
Content-Type: [application/json; charset=utf-8]
|
||||||
|
Link: ['<http://localhost:3000/api/v1/accounts/1234567890123456/statuses?limit=5&max_id=103704149300069225>;
|
||||||
|
rel="next", <http://localhost:3000/api/v1/accounts/1234567890123456/statuses?limit=5&min_id=103704149365440398>;
|
||||||
|
rel="prev"']
|
||||||
|
Referrer-Policy: [strict-origin-when-cross-origin]
|
||||||
|
Transfer-Encoding: [chunked]
|
||||||
|
Vary: ['Accept-Encoding, Origin']
|
||||||
|
X-Content-Type-Options: [nosniff]
|
||||||
|
X-Download-Options: [noopen]
|
||||||
|
X-Frame-Options: [SAMEORIGIN]
|
||||||
|
X-Permitted-Cross-Domain-Policies: [none]
|
||||||
|
X-Request-Id: [03a7b3a0-09b2-4281-833e-d5885806890e]
|
||||||
|
X-Runtime: ['0.169965']
|
||||||
|
X-XSS-Protection: [1; mode=block]
|
||||||
|
content-length: ['6656']
|
||||||
|
status: {code: 200, message: OK}
|
||||||
|
- request:
|
||||||
|
body: null
|
||||||
|
headers:
|
||||||
|
Accept: ['*/*']
|
||||||
|
Accept-Encoding: ['gzip, deflate']
|
||||||
|
Authorization: [Bearer __MASTODON_PY_TEST_ACCESS_TOKEN]
|
||||||
|
Connection: [keep-alive]
|
||||||
|
Content-Length: ['0']
|
||||||
|
User-Agent: [python-requests/2.18.4]
|
||||||
|
method: DELETE
|
||||||
|
uri: http://localhost:3000/api/v1/statuses/103704149189751466
|
||||||
|
response:
|
||||||
|
body: {string: '{"id":"103704149189751466","created_at":"2020-02-22T19:28:57.717Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"public","language":"ja","uri":"http://localhost/users/mastodonpy_test/statuses/103704149189751466","url":"http://localhost/@mastodonpy_test/103704149189751466","replies_count":0,"reblogs_count":0,"favourites_count":0,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"pinned":false,"text":"Toot
|
||||||
|
number 0!","reblog":null,"application":{"name":"Mastodon.py test suite","website":null},"account":{"id":"1234567890123456","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":false,"bot":false,"discoverable":false,"group":false,"created_at":"2020-02-22T20:26:54.402Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@mastodonpy_test","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":11,"last_status_at":"2020-02-22","emojis":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null}'}
|
||||||
|
headers:
|
||||||
|
Cache-Control: ['no-cache, no-store']
|
||||||
|
Content-Type: [application/json; charset=utf-8]
|
||||||
|
Referrer-Policy: [strict-origin-when-cross-origin]
|
||||||
|
Transfer-Encoding: [chunked]
|
||||||
|
Vary: ['Accept-Encoding, Origin']
|
||||||
|
X-Content-Type-Options: [nosniff]
|
||||||
|
X-Download-Options: [noopen]
|
||||||
|
X-Frame-Options: [SAMEORIGIN]
|
||||||
|
X-Permitted-Cross-Domain-Policies: [none]
|
||||||
|
X-Request-Id: [c9121201-0be7-4c73-bdce-884e21d969d4]
|
||||||
|
X-Runtime: ['0.157991']
|
||||||
|
X-XSS-Protection: [1; mode=block]
|
||||||
|
content-length: ['1300']
|
||||||
|
status: {code: 200, message: OK}
|
||||||
|
- request:
|
||||||
|
body: null
|
||||||
|
headers:
|
||||||
|
Accept: ['*/*']
|
||||||
|
Accept-Encoding: ['gzip, deflate']
|
||||||
|
Authorization: [Bearer __MASTODON_PY_TEST_ACCESS_TOKEN]
|
||||||
|
Connection: [keep-alive]
|
||||||
|
Content-Length: ['0']
|
||||||
|
User-Agent: [python-requests/2.18.4]
|
||||||
|
method: DELETE
|
||||||
|
uri: http://localhost:3000/api/v1/statuses/103704149240204204
|
||||||
|
response:
|
||||||
|
body: {string: '{"id":"103704149240204204","created_at":"2020-02-22T19:28:58.181Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"public","language":"ja","uri":"http://localhost/users/mastodonpy_test/statuses/103704149240204204","url":"http://localhost/@mastodonpy_test/103704149240204204","replies_count":0,"reblogs_count":0,"favourites_count":0,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"pinned":false,"text":"Toot
|
||||||
|
number 1!","reblog":null,"application":{"name":"Mastodon.py test suite","website":null},"account":{"id":"1234567890123456","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":false,"bot":false,"discoverable":false,"group":false,"created_at":"2020-02-22T20:26:54.402Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@mastodonpy_test","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":10,"last_status_at":"2020-02-22","emojis":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null}'}
|
||||||
|
headers:
|
||||||
|
Cache-Control: ['no-cache, no-store']
|
||||||
|
Content-Type: [application/json; charset=utf-8]
|
||||||
|
Referrer-Policy: [strict-origin-when-cross-origin]
|
||||||
|
Transfer-Encoding: [chunked]
|
||||||
|
Vary: ['Accept-Encoding, Origin']
|
||||||
|
X-Content-Type-Options: [nosniff]
|
||||||
|
X-Download-Options: [noopen]
|
||||||
|
X-Frame-Options: [SAMEORIGIN]
|
||||||
|
X-Permitted-Cross-Domain-Policies: [none]
|
||||||
|
X-Request-Id: [e2df2022-af35-41e7-ab48-c888b17fb266]
|
||||||
|
X-Runtime: ['0.205063']
|
||||||
|
X-XSS-Protection: [1; mode=block]
|
||||||
|
content-length: ['1300']
|
||||||
|
status: {code: 200, message: OK}
|
||||||
|
- request:
|
||||||
|
body: null
|
||||||
|
headers:
|
||||||
|
Accept: ['*/*']
|
||||||
|
Accept-Encoding: ['gzip, deflate']
|
||||||
|
Authorization: [Bearer __MASTODON_PY_TEST_ACCESS_TOKEN]
|
||||||
|
Connection: [keep-alive]
|
||||||
|
Content-Length: ['0']
|
||||||
|
User-Agent: [python-requests/2.18.4]
|
||||||
|
method: DELETE
|
||||||
|
uri: http://localhost:3000/api/v1/statuses/103704149255716248
|
||||||
|
response:
|
||||||
|
body: {string: '{"id":"103704149255716248","created_at":"2020-02-22T19:28:58.413Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"public","language":"ja","uri":"http://localhost/users/mastodonpy_test/statuses/103704149255716248","url":"http://localhost/@mastodonpy_test/103704149255716248","replies_count":0,"reblogs_count":0,"favourites_count":0,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"pinned":false,"text":"Toot
|
||||||
|
number 2!","reblog":null,"application":{"name":"Mastodon.py test suite","website":null},"account":{"id":"1234567890123456","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":false,"bot":false,"discoverable":false,"group":false,"created_at":"2020-02-22T20:26:54.402Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@mastodonpy_test","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":9,"last_status_at":"2020-02-22","emojis":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null}'}
|
||||||
|
headers:
|
||||||
|
Cache-Control: ['no-cache, no-store']
|
||||||
|
Content-Type: [application/json; charset=utf-8]
|
||||||
|
Referrer-Policy: [strict-origin-when-cross-origin]
|
||||||
|
Transfer-Encoding: [chunked]
|
||||||
|
Vary: ['Accept-Encoding, Origin']
|
||||||
|
X-Content-Type-Options: [nosniff]
|
||||||
|
X-Download-Options: [noopen]
|
||||||
|
X-Frame-Options: [SAMEORIGIN]
|
||||||
|
X-Permitted-Cross-Domain-Policies: [none]
|
||||||
|
X-Request-Id: [cd3f1791-e612-445c-853a-d1b49229fdc7]
|
||||||
|
X-Runtime: ['0.173011']
|
||||||
|
X-XSS-Protection: [1; mode=block]
|
||||||
|
content-length: ['1299']
|
||||||
|
status: {code: 200, message: OK}
|
||||||
|
- request:
|
||||||
|
body: null
|
||||||
|
headers:
|
||||||
|
Accept: ['*/*']
|
||||||
|
Accept-Encoding: ['gzip, deflate']
|
||||||
|
Authorization: [Bearer __MASTODON_PY_TEST_ACCESS_TOKEN]
|
||||||
|
Connection: [keep-alive]
|
||||||
|
Content-Length: ['0']
|
||||||
|
User-Agent: [python-requests/2.18.4]
|
||||||
|
method: DELETE
|
||||||
|
uri: http://localhost:3000/api/v1/statuses/103704149270849591
|
||||||
|
response:
|
||||||
|
body: {string: '{"id":"103704149270849591","created_at":"2020-02-22T19:28:58.643Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"public","language":"ja","uri":"http://localhost/users/mastodonpy_test/statuses/103704149270849591","url":"http://localhost/@mastodonpy_test/103704149270849591","replies_count":0,"reblogs_count":0,"favourites_count":0,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"pinned":false,"text":"Toot
|
||||||
|
number 3!","reblog":null,"application":{"name":"Mastodon.py test suite","website":null},"account":{"id":"1234567890123456","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":false,"bot":false,"discoverable":false,"group":false,"created_at":"2020-02-22T20:26:54.402Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@mastodonpy_test","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":8,"last_status_at":"2020-02-22","emojis":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null}'}
|
||||||
|
headers:
|
||||||
|
Cache-Control: ['no-cache, no-store']
|
||||||
|
Content-Type: [application/json; charset=utf-8]
|
||||||
|
Referrer-Policy: [strict-origin-when-cross-origin]
|
||||||
|
Transfer-Encoding: [chunked]
|
||||||
|
Vary: ['Accept-Encoding, Origin']
|
||||||
|
X-Content-Type-Options: [nosniff]
|
||||||
|
X-Download-Options: [noopen]
|
||||||
|
X-Frame-Options: [SAMEORIGIN]
|
||||||
|
X-Permitted-Cross-Domain-Policies: [none]
|
||||||
|
X-Request-Id: [86e29869-c84c-4bda-ba30-cf3b7c047351]
|
||||||
|
X-Runtime: ['0.162408']
|
||||||
|
X-XSS-Protection: [1; mode=block]
|
||||||
|
content-length: ['1299']
|
||||||
|
status: {code: 200, message: OK}
|
||||||
|
- request:
|
||||||
|
body: null
|
||||||
|
headers:
|
||||||
|
Accept: ['*/*']
|
||||||
|
Accept-Encoding: ['gzip, deflate']
|
||||||
|
Authorization: [Bearer __MASTODON_PY_TEST_ACCESS_TOKEN]
|
||||||
|
Connection: [keep-alive]
|
||||||
|
Content-Length: ['0']
|
||||||
|
User-Agent: [python-requests/2.18.4]
|
||||||
|
method: DELETE
|
||||||
|
uri: http://localhost:3000/api/v1/statuses/103704149285153724
|
||||||
|
response:
|
||||||
|
body: {string: '{"id":"103704149285153724","created_at":"2020-02-22T19:28:58.863Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"public","language":"ja","uri":"http://localhost/users/mastodonpy_test/statuses/103704149285153724","url":"http://localhost/@mastodonpy_test/103704149285153724","replies_count":0,"reblogs_count":0,"favourites_count":0,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"pinned":false,"text":"Toot
|
||||||
|
number 4!","reblog":null,"application":{"name":"Mastodon.py test suite","website":null},"account":{"id":"1234567890123456","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":false,"bot":false,"discoverable":false,"group":false,"created_at":"2020-02-22T20:26:54.402Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@mastodonpy_test","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":7,"last_status_at":"2020-02-22","emojis":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null}'}
|
||||||
|
headers:
|
||||||
|
Cache-Control: ['no-cache, no-store']
|
||||||
|
Content-Type: [application/json; charset=utf-8]
|
||||||
|
Referrer-Policy: [strict-origin-when-cross-origin]
|
||||||
|
Transfer-Encoding: [chunked]
|
||||||
|
Vary: ['Accept-Encoding, Origin']
|
||||||
|
X-Content-Type-Options: [nosniff]
|
||||||
|
X-Download-Options: [noopen]
|
||||||
|
X-Frame-Options: [SAMEORIGIN]
|
||||||
|
X-Permitted-Cross-Domain-Policies: [none]
|
||||||
|
X-Request-Id: [4c6c6433-9a62-4b28-ad17-98c12279e9da]
|
||||||
|
X-Runtime: ['0.126905']
|
||||||
|
X-XSS-Protection: [1; mode=block]
|
||||||
|
content-length: ['1299']
|
||||||
|
status: {code: 200, message: OK}
|
||||||
|
- request:
|
||||||
|
body: null
|
||||||
|
headers:
|
||||||
|
Accept: ['*/*']
|
||||||
|
Accept-Encoding: ['gzip, deflate']
|
||||||
|
Authorization: [Bearer __MASTODON_PY_TEST_ACCESS_TOKEN]
|
||||||
|
Connection: [keep-alive]
|
||||||
|
Content-Length: ['0']
|
||||||
|
User-Agent: [python-requests/2.18.4]
|
||||||
|
method: DELETE
|
||||||
|
uri: http://localhost:3000/api/v1/statuses/103704149300069225
|
||||||
|
response:
|
||||||
|
body: {string: '{"id":"103704149300069225","created_at":"2020-02-22T19:28:59.095Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"public","language":"ja","uri":"http://localhost/users/mastodonpy_test/statuses/103704149300069225","url":"http://localhost/@mastodonpy_test/103704149300069225","replies_count":0,"reblogs_count":0,"favourites_count":0,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"pinned":false,"text":"Toot
|
||||||
|
number 5!","reblog":null,"application":{"name":"Mastodon.py test suite","website":null},"account":{"id":"1234567890123456","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":false,"bot":false,"discoverable":false,"group":false,"created_at":"2020-02-22T20:26:54.402Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@mastodonpy_test","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":6,"last_status_at":"2020-02-22","emojis":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null}'}
|
||||||
|
headers:
|
||||||
|
Cache-Control: ['no-cache, no-store']
|
||||||
|
Content-Type: [application/json; charset=utf-8]
|
||||||
|
Referrer-Policy: [strict-origin-when-cross-origin]
|
||||||
|
Transfer-Encoding: [chunked]
|
||||||
|
Vary: ['Accept-Encoding, Origin']
|
||||||
|
X-Content-Type-Options: [nosniff]
|
||||||
|
X-Download-Options: [noopen]
|
||||||
|
X-Frame-Options: [SAMEORIGIN]
|
||||||
|
X-Permitted-Cross-Domain-Policies: [none]
|
||||||
|
X-Request-Id: [a4a8ad1a-7b70-4322-b524-34c7a6966505]
|
||||||
|
X-Runtime: ['0.130927']
|
||||||
|
X-XSS-Protection: [1; mode=block]
|
||||||
|
content-length: ['1299']
|
||||||
|
status: {code: 200, message: OK}
|
||||||
|
- request:
|
||||||
|
body: null
|
||||||
|
headers:
|
||||||
|
Accept: ['*/*']
|
||||||
|
Accept-Encoding: ['gzip, deflate']
|
||||||
|
Authorization: [Bearer __MASTODON_PY_TEST_ACCESS_TOKEN]
|
||||||
|
Connection: [keep-alive]
|
||||||
|
Content-Length: ['0']
|
||||||
|
User-Agent: [python-requests/2.18.4]
|
||||||
|
method: DELETE
|
||||||
|
uri: http://localhost:3000/api/v1/statuses/103704149316561035
|
||||||
|
response:
|
||||||
|
body: {string: '{"id":"103704149316561035","created_at":"2020-02-22T19:28:59.341Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"public","language":"ja","uri":"http://localhost/users/mastodonpy_test/statuses/103704149316561035","url":"http://localhost/@mastodonpy_test/103704149316561035","replies_count":0,"reblogs_count":0,"favourites_count":0,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"pinned":false,"text":"Toot
|
||||||
|
number 6!","reblog":null,"application":{"name":"Mastodon.py test suite","website":null},"account":{"id":"1234567890123456","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":false,"bot":false,"discoverable":false,"group":false,"created_at":"2020-02-22T20:26:54.402Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@mastodonpy_test","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":5,"last_status_at":"2020-02-22","emojis":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null}'}
|
||||||
|
headers:
|
||||||
|
Cache-Control: ['no-cache, no-store']
|
||||||
|
Content-Type: [application/json; charset=utf-8]
|
||||||
|
Referrer-Policy: [strict-origin-when-cross-origin]
|
||||||
|
Transfer-Encoding: [chunked]
|
||||||
|
Vary: ['Accept-Encoding, Origin']
|
||||||
|
X-Content-Type-Options: [nosniff]
|
||||||
|
X-Download-Options: [noopen]
|
||||||
|
X-Frame-Options: [SAMEORIGIN]
|
||||||
|
X-Permitted-Cross-Domain-Policies: [none]
|
||||||
|
X-Request-Id: [2a19b9cb-7487-4c3f-9b5a-f8796526945b]
|
||||||
|
X-Runtime: ['0.137676']
|
||||||
|
X-XSS-Protection: [1; mode=block]
|
||||||
|
content-length: ['1299']
|
||||||
|
status: {code: 200, message: OK}
|
||||||
|
- request:
|
||||||
|
body: null
|
||||||
|
headers:
|
||||||
|
Accept: ['*/*']
|
||||||
|
Accept-Encoding: ['gzip, deflate']
|
||||||
|
Authorization: [Bearer __MASTODON_PY_TEST_ACCESS_TOKEN]
|
||||||
|
Connection: [keep-alive]
|
||||||
|
Content-Length: ['0']
|
||||||
|
User-Agent: [python-requests/2.18.4]
|
||||||
|
method: DELETE
|
||||||
|
uri: http://localhost:3000/api/v1/statuses/103704149334172751
|
||||||
|
response:
|
||||||
|
body: {string: '{"id":"103704149334172751","created_at":"2020-02-22T19:28:59.612Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"public","language":"ja","uri":"http://localhost/users/mastodonpy_test/statuses/103704149334172751","url":"http://localhost/@mastodonpy_test/103704149334172751","replies_count":0,"reblogs_count":0,"favourites_count":0,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"pinned":false,"text":"Toot
|
||||||
|
number 7!","reblog":null,"application":{"name":"Mastodon.py test suite","website":null},"account":{"id":"1234567890123456","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":false,"bot":false,"discoverable":false,"group":false,"created_at":"2020-02-22T20:26:54.402Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@mastodonpy_test","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":4,"last_status_at":"2020-02-22","emojis":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null}'}
|
||||||
|
headers:
|
||||||
|
Cache-Control: ['no-cache, no-store']
|
||||||
|
Content-Type: [application/json; charset=utf-8]
|
||||||
|
Referrer-Policy: [strict-origin-when-cross-origin]
|
||||||
|
Transfer-Encoding: [chunked]
|
||||||
|
Vary: ['Accept-Encoding, Origin']
|
||||||
|
X-Content-Type-Options: [nosniff]
|
||||||
|
X-Download-Options: [noopen]
|
||||||
|
X-Frame-Options: [SAMEORIGIN]
|
||||||
|
X-Permitted-Cross-Domain-Policies: [none]
|
||||||
|
X-Request-Id: [7a8d07ec-da26-4554-8011-46a70cf4c356]
|
||||||
|
X-Runtime: ['0.138911']
|
||||||
|
X-XSS-Protection: [1; mode=block]
|
||||||
|
content-length: ['1299']
|
||||||
|
status: {code: 200, message: OK}
|
||||||
|
- request:
|
||||||
|
body: null
|
||||||
|
headers:
|
||||||
|
Accept: ['*/*']
|
||||||
|
Accept-Encoding: ['gzip, deflate']
|
||||||
|
Authorization: [Bearer __MASTODON_PY_TEST_ACCESS_TOKEN]
|
||||||
|
Connection: [keep-alive]
|
||||||
|
Content-Length: ['0']
|
||||||
|
User-Agent: [python-requests/2.18.4]
|
||||||
|
method: DELETE
|
||||||
|
uri: http://localhost:3000/api/v1/statuses/103704149348344165
|
||||||
|
response:
|
||||||
|
body: {string: '{"id":"103704149348344165","created_at":"2020-02-22T19:28:59.827Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"public","language":"ja","uri":"http://localhost/users/mastodonpy_test/statuses/103704149348344165","url":"http://localhost/@mastodonpy_test/103704149348344165","replies_count":0,"reblogs_count":0,"favourites_count":0,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"pinned":false,"text":"Toot
|
||||||
|
number 8!","reblog":null,"application":{"name":"Mastodon.py test suite","website":null},"account":{"id":"1234567890123456","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":false,"bot":false,"discoverable":false,"group":false,"created_at":"2020-02-22T20:26:54.402Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@mastodonpy_test","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":3,"last_status_at":"2020-02-22","emojis":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null}'}
|
||||||
|
headers:
|
||||||
|
Cache-Control: ['no-cache, no-store']
|
||||||
|
Content-Type: [application/json; charset=utf-8]
|
||||||
|
Referrer-Policy: [strict-origin-when-cross-origin]
|
||||||
|
Transfer-Encoding: [chunked]
|
||||||
|
Vary: ['Accept-Encoding, Origin']
|
||||||
|
X-Content-Type-Options: [nosniff]
|
||||||
|
X-Download-Options: [noopen]
|
||||||
|
X-Frame-Options: [SAMEORIGIN]
|
||||||
|
X-Permitted-Cross-Domain-Policies: [none]
|
||||||
|
X-Request-Id: [4cdbde9e-b14a-405e-840e-d5ebac69f1a6]
|
||||||
|
X-Runtime: ['0.143361']
|
||||||
|
X-XSS-Protection: [1; mode=block]
|
||||||
|
content-length: ['1299']
|
||||||
|
status: {code: 200, message: OK}
|
||||||
|
- request:
|
||||||
|
body: null
|
||||||
|
headers:
|
||||||
|
Accept: ['*/*']
|
||||||
|
Accept-Encoding: ['gzip, deflate']
|
||||||
|
Authorization: [Bearer __MASTODON_PY_TEST_ACCESS_TOKEN]
|
||||||
|
Connection: [keep-alive]
|
||||||
|
Content-Length: ['0']
|
||||||
|
User-Agent: [python-requests/2.18.4]
|
||||||
|
method: DELETE
|
||||||
|
uri: http://localhost:3000/api/v1/statuses/103704149365440398
|
||||||
|
response:
|
||||||
|
body: {string: '{"id":"103704149365440398","created_at":"2020-02-22T19:29:00.089Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"public","language":"ja","uri":"http://localhost/users/mastodonpy_test/statuses/103704149365440398","url":"http://localhost/@mastodonpy_test/103704149365440398","replies_count":0,"reblogs_count":0,"favourites_count":0,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"pinned":false,"text":"Toot
|
||||||
|
number 9!","reblog":null,"application":{"name":"Mastodon.py test suite","website":null},"account":{"id":"1234567890123456","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":false,"bot":false,"discoverable":false,"group":false,"created_at":"2020-02-22T20:26:54.402Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@mastodonpy_test","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":2,"last_status_at":"2020-02-22","emojis":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null}'}
|
||||||
|
headers:
|
||||||
|
Cache-Control: ['no-cache, no-store']
|
||||||
|
Content-Type: [application/json; charset=utf-8]
|
||||||
|
Referrer-Policy: [strict-origin-when-cross-origin]
|
||||||
|
Transfer-Encoding: [chunked]
|
||||||
|
Vary: ['Accept-Encoding, Origin']
|
||||||
|
X-Content-Type-Options: [nosniff]
|
||||||
|
X-Download-Options: [noopen]
|
||||||
|
X-Frame-Options: [SAMEORIGIN]
|
||||||
|
X-Permitted-Cross-Domain-Policies: [none]
|
||||||
|
X-Request-Id: [41b9b30e-23fa-4929-a1a2-417ae0d28b48]
|
||||||
|
X-Runtime: ['0.130683']
|
||||||
|
X-XSS-Protection: [1; mode=block]
|
||||||
|
content-length: ['1299']
|
||||||
|
status: {code: 200, message: OK}
|
||||||
|
version: 1
|
|
@ -8,7 +8,8 @@ def _api(access_token='__MASTODON_PY_TEST_ACCESS_TOKEN', version="3.1.1", versio
|
||||||
client_secret='__MASTODON_PY_TEST_CLIENT_SECRET',
|
client_secret='__MASTODON_PY_TEST_CLIENT_SECRET',
|
||||||
access_token=access_token,
|
access_token=access_token,
|
||||||
mastodon_version=version,
|
mastodon_version=version,
|
||||||
version_check_mode=version_check_mode)
|
version_check_mode=version_check_mode,
|
||||||
|
user_agent='tests/v311')
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
|
|
|
@ -11,6 +11,11 @@ def test_bookmarks(api, status):
|
||||||
assert len(bookmarked_statuses) > 0
|
assert len(bookmarked_statuses) > 0
|
||||||
assert status_bookmarked == bookmarked_statuses[0]
|
assert status_bookmarked == bookmarked_statuses[0]
|
||||||
|
|
||||||
|
bookmarked_statuses = api.bookmarks(limit=1)
|
||||||
|
assert bookmarked_statuses
|
||||||
|
assert len(bookmarked_statuses) > 0
|
||||||
|
assert status_bookmarked == bookmarked_statuses[0]
|
||||||
|
|
||||||
status_unbookmarked = api.status_unbookmark(status_bookmarked)
|
status_unbookmarked = api.status_unbookmark(status_bookmarked)
|
||||||
assert status_unbookmarked
|
assert status_unbookmarked
|
||||||
assert status_unbookmarked.bookmarked == False
|
assert status_unbookmarked.bookmarked == False
|
||||||
|
|
|
@ -31,7 +31,7 @@ def test_create_app(mocker, to_file=None, redirect_uris=None, website=None):
|
||||||
def test_create_app_to_file(mocker, tmpdir):
|
def test_create_app_to_file(mocker, tmpdir):
|
||||||
filepath = tmpdir.join('credentials')
|
filepath = tmpdir.join('credentials')
|
||||||
test_create_app(mocker, to_file=str(filepath))
|
test_create_app(mocker, to_file=str(filepath))
|
||||||
assert filepath.read_text('UTF-8') == "foo\nbar\nhttps://example.com\n"
|
assert filepath.read_text('UTF-8') == "foo\nbar\nhttps://example.com\nMastodon.py test suite\n"
|
||||||
|
|
||||||
def test_create_app_redirect_uris(mocker):
|
def test_create_app_redirect_uris(mocker):
|
||||||
test_create_app(mocker, redirect_uris='http://example.net')
|
test_create_app(mocker, redirect_uris='http://example.net')
|
||||||
|
|
|
@ -36,6 +36,17 @@ def test_fetch_next_previous(api):
|
||||||
|
|
||||||
@pytest.mark.vcr()
|
@pytest.mark.vcr()
|
||||||
def test_fetch_next_previous_from_pagination_info(api):
|
def test_fetch_next_previous_from_pagination_info(api):
|
||||||
|
account = api.account_verify_credentials()
|
||||||
|
with many_statuses(api):
|
||||||
|
statuses = api.account_statuses(account['id'], limit=5)
|
||||||
|
next_statuses = api.fetch_next(statuses._pagination_next)
|
||||||
|
assert next_statuses
|
||||||
|
previous_statuses = api.fetch_previous(next_statuses._pagination_prev)
|
||||||
|
assert previous_statuses
|
||||||
|
|
||||||
|
@pytest.mark.vcr()
|
||||||
|
def test_fetch_next_previous_from_pagination_info_oldstyle(api):
|
||||||
|
# Old style compatibility mode. The storage in the list items is not anymore internally used.
|
||||||
account = api.account_verify_credentials()
|
account = api.account_verify_credentials()
|
||||||
with many_statuses(api):
|
with many_statuses(api):
|
||||||
statuses = api.account_statuses(account['id'], limit=5)
|
statuses = api.account_statuses(account['id'], limit=5)
|
||||||
|
@ -59,6 +70,17 @@ def test_fetch_next_previous_from_pagination_info_old_pagination(api):
|
||||||
with vcr.use_cassette('test_fetch_next_previous_from_pagination_info.yaml', cassette_library_dir='tests/cassettes_old_pagination', record_mode='none'):
|
with vcr.use_cassette('test_fetch_next_previous_from_pagination_info.yaml', cassette_library_dir='tests/cassettes_old_pagination', record_mode='none'):
|
||||||
account = api.account_verify_credentials()
|
account = api.account_verify_credentials()
|
||||||
|
|
||||||
|
with many_statuses(api):
|
||||||
|
statuses = api.account_statuses(account['id'], limit=5)
|
||||||
|
next_statuses = api.fetch_next(statuses._pagination_next)
|
||||||
|
assert next_statuses
|
||||||
|
previous_statuses = api.fetch_previous(next_statuses._pagination_prev)
|
||||||
|
assert previous_statuses
|
||||||
|
|
||||||
|
# Old style compatibility mode. The storage in the list items is not anymore internally used.
|
||||||
|
with vcr.use_cassette('test_fetch_next_previous_from_pagination_info.yaml', cassette_library_dir='tests/cassettes_old_pagination', record_mode='none'):
|
||||||
|
account = api.account_verify_credentials()
|
||||||
|
|
||||||
with many_statuses(api):
|
with many_statuses(api):
|
||||||
statuses = api.account_statuses(account['id'], limit=5)
|
statuses = api.account_statuses(account['id'], limit=5)
|
||||||
next_statuses = api.fetch_next(statuses[-1]._pagination_next)
|
next_statuses = api.fetch_next(statuses[-1]._pagination_next)
|
||||||
|
@ -86,5 +108,9 @@ def test_link_headers(api):
|
||||||
})
|
})
|
||||||
|
|
||||||
resp = api.timeline_hashtag(UNLIKELY_HASHTAG)
|
resp = api.timeline_hashtag(UNLIKELY_HASHTAG)
|
||||||
|
assert resp._pagination_next['max_id'] == _id
|
||||||
|
assert resp._pagination_prev['since_id'] == _id
|
||||||
|
|
||||||
|
# Old style compatibility mode. The storage in the list items is not anymore internally used.
|
||||||
assert resp[0]._pagination_next['max_id'] == _id
|
assert resp[0]._pagination_next['max_id'] == _id
|
||||||
assert resp[0]._pagination_prev['since_id'] == _id
|
assert resp[0]._pagination_prev['since_id'] == _id
|
|
@ -61,6 +61,8 @@ class Listener(StreamListener):
|
||||||
self.notifications = []
|
self.notifications = []
|
||||||
self.deletes = []
|
self.deletes = []
|
||||||
self.heartbeats = 0
|
self.heartbeats = 0
|
||||||
|
self.bla_called = False
|
||||||
|
self.do_something_called = False
|
||||||
|
|
||||||
def on_update(self, status):
|
def on_update(self, status):
|
||||||
self.updates.append(status)
|
self.updates.append(status)
|
||||||
|
@ -72,6 +74,11 @@ class Listener(StreamListener):
|
||||||
self.deletes.append(status_id)
|
self.deletes.append(status_id)
|
||||||
|
|
||||||
def on_blahblah(self, data):
|
def on_blahblah(self, data):
|
||||||
|
self.bla_called = True
|
||||||
|
pass
|
||||||
|
|
||||||
|
def on_do_something(self, data):
|
||||||
|
self.do_something_called = True
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def handle_heartbeat(self):
|
def handle_heartbeat(self):
|
||||||
|
@ -158,6 +165,37 @@ def test_unknown_event():
|
||||||
'data: {}',
|
'data: {}',
|
||||||
'',
|
'',
|
||||||
])
|
])
|
||||||
|
assert listener.bla_called == True
|
||||||
|
assert listener.updates == []
|
||||||
|
assert listener.notifications == []
|
||||||
|
assert listener.deletes == []
|
||||||
|
assert listener.heartbeats == 0
|
||||||
|
|
||||||
|
def test_unknown_handled_event():
|
||||||
|
"""Be tolerant of new unknown event types, if on_unknown_event is available"""
|
||||||
|
listener = Listener()
|
||||||
|
listener.on_unknown_event = lambda name, payload: None
|
||||||
|
|
||||||
|
listener.handle_stream_([
|
||||||
|
'event: complete.new.event',
|
||||||
|
'data: {"k": "v"}',
|
||||||
|
'',
|
||||||
|
])
|
||||||
|
|
||||||
|
assert listener.updates == []
|
||||||
|
assert listener.notifications == []
|
||||||
|
assert listener.deletes == []
|
||||||
|
assert listener.heartbeats == 0
|
||||||
|
|
||||||
|
def test_dotted_unknown_event():
|
||||||
|
"""Be tolerant of new event types with dots in the event-name"""
|
||||||
|
listener = Listener()
|
||||||
|
listener.handle_stream_([
|
||||||
|
'event: do.something',
|
||||||
|
'data: {}',
|
||||||
|
'',
|
||||||
|
])
|
||||||
|
assert listener.do_something_called == True
|
||||||
assert listener.updates == []
|
assert listener.updates == []
|
||||||
assert listener.notifications == []
|
assert listener.notifications == []
|
||||||
assert listener.deletes == []
|
assert listener.deletes == []
|
||||||
|
@ -169,7 +207,7 @@ def test_invalid_event():
|
||||||
with pytest.raises(MastodonMalformedEventError):
|
with pytest.raises(MastodonMalformedEventError):
|
||||||
listener.handle_stream_([
|
listener.handle_stream_([
|
||||||
'event: whatup',
|
'event: whatup',
|
||||||
'data: {}',
|
'data: {"k": "v"}',
|
||||||
'',
|
'',
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
Loading…
Referencia en una nova incidència