diff --git a/mastodon/internals.py b/mastodon/internals.py index ddb5084..3b93a5b 100644 --- a/mastodon/internals.py +++ b/mastodon/internals.py @@ -82,7 +82,13 @@ class Mastodon(): return_type = override_type except: return_type = AttribAccessDict - return try_cast_recurse(return_type, value) + return_val = try_cast_recurse(return_type, value) + return_type_repr = None + try: + return_type_repr = return_val._mastopy_type + except: + pass + return return_val, return_type_repr def __api_request(self, method, endpoint, params={}, files={}, headers={}, access_token_override=None, base_url_override=None, do_ratelimiting=True, use_json=False, parse=True, return_response_object=False, skip_error_check=False, lang_override=None, override_type=None, @@ -93,6 +99,7 @@ class Mastodon(): Does a large amount of different things that I should document one day, but not today. """ response = None + final_type = None remaining_wait = 0 # Add language to params if not None @@ -208,7 +215,7 @@ class Mastodon(): if not response_object.ok: try: - response = self.__try_cast_to_type(response_object.json(), override_type = override_type) # TODO actually cast to an error type + response, final_type = self.__try_cast_to_type(response_object.json(), override_type = override_type) # TODO actually cast to an error type if isinstance(response, dict) and 'error' in response: error_msg = response['error'] elif isinstance(response, str): @@ -270,7 +277,7 @@ class Mastodon(): f"bad json content was {response_object.content!r}.", f"Exception was: {e}" ) - response = self.__try_cast_to_type(response, override_type = override_type) + response, final_type = self.__try_cast_to_type(response, override_type = override_type) else: response = response_object.content @@ -278,6 +285,8 @@ class Mastodon(): if (isinstance(response, list) or force_pagination) and 'Link' in response_object.headers and response_object.headers['Link'] != "": if not isinstance(response, PaginatableList) and not force_pagination: response = PaginatableList(response) + if final_type is None: + final_type = str(type(response)) tmp_urls = requests.utils.parse_header_links(response_object.headers['Link'].rstrip('>').replace('>,<', ',<')) for url in tmp_urls: if 'rel' not in url: @@ -292,6 +301,7 @@ class Mastodon(): next_params = copy.deepcopy(params) next_params['_pagination_method'] = method next_params['_pagination_endpoint'] = endpoint + next_params['_mastopy_type'] = final_type max_id = matchgroups.group(1) if max_id.isdigit(): next_params['max_id'] = int(max_id) @@ -313,6 +323,7 @@ class Mastodon(): prev_params = copy.deepcopy(params) prev_params['_pagination_method'] = method prev_params['_pagination_endpoint'] = endpoint + prev_params['_mastopy_type'] = final_type since_id = matchgroups.group(1) if since_id.isdigit(): prev_params['since_id'] = int(since_id) @@ -328,6 +339,7 @@ class Mastodon(): prev_params = copy.deepcopy(params) prev_params['_pagination_method'] = method prev_params['_pagination_endpoint'] = endpoint + prev_params['_mastopy_type'] = final_type min_id = matchgroups.group(1) if min_id.isdigit(): prev_params['min_id'] = int(min_id) diff --git a/mastodon/types_base.py b/mastodon/types_base.py index d838572..6a846ab 100644 --- a/mastodon/types_base.py +++ b/mastodon/types_base.py @@ -54,6 +54,39 @@ This is a breaking change, and I'm sorry about it, but this will make every piec of software using Mastodon.py more robust in the long run. """ +def _str_to_type(mastopy_type): + """ + String name to internal type resolver + """ + # See if we need to parse a sub-type (i.e. [] in the type name + sub_type = None + if "[" in mastopy_type and "]" in mastopy_type: + mastopy_type, sub_type = mastopy_type.split("[") + sub_type = sub_type[:-1] + if mastopy_type not in ["PaginatableList", "NonPaginatableList", "typing.Optional", "typing.Union"]: + raise ValueError(f"Subtype not allowed for type {mastopy_type} and subtype {sub_type}") + if "[" in mastopy_type or "]" in mastopy_type: + raise ValueError(f"Invalid type {mastopy_type}") + if sub_type is not None and ("[" in sub_type or "]" in sub_type): + raise ValueError(f"Invalid subtype {sub_type}") + + # Build the actual type object. + from mastodon.return_types import ENTITY_NAME_MAP + full_type = None + if sub_type is not None: + sub_type = ENTITY_NAME_MAP.get(sub_type, None) + full_type = { + "PaginatableList": PaginatableList[sub_type], + "NonPaginatableList": NonPaginatableList[sub_type], + "typing.Optional": Optional[sub_type], + "typing.Union": Union[sub_type], + }[mastopy_type] + else: + full_type = ENTITY_NAME_MAP.get(mastopy_type, None) + if full_type is None: + raise ValueError(f"Unknown type {mastopy_type}") + return full_type + class MaybeSnowflakeIdType(str): """ Represents, maybe, a snowflake ID. @@ -282,6 +315,8 @@ def try_cast_recurse(t, value, union_specializer=None): * Casting to Union, trying all types in the union until one works Gives up and returns as-is if none of the above work. """ + if type(t) == str: + t = _str_to_type(t) if value is None: return value t = resolve_type(t) @@ -354,7 +389,7 @@ class Entity(): """ def __init__(self): self._mastopy_type = None - + def to_json(self, pretty=True) -> str: """ Serialize to JSON. @@ -378,16 +413,21 @@ class Entity(): remove_renamed_fields(mastopy_data) serialize_data = { - "_mastopy_version": "2.0.0", + "_mastopy_version": "2.0.1", "_mastopy_type": self._mastopy_type, - "_mastopy_data": mastopy_data + "_mastopy_data": mastopy_data, + "_mastopy_extra_data": {} } + if hasattr(self, "_pagination_next") and self._pagination_next is not None: + serialize_data["_mastopy_extra_data"]["_pagination_next"] = self._pagination_next + if hasattr(self, "_pagination_prev") and self._pagination_prev is not None: + serialize_data["_mastopy_extra_data"]["_pagination_prev"] = self._pagination_prev + def json_serial(obj): if isinstance(obj, datetime): return obj.isoformat() - if pretty: return json.dumps(serialize_data, default=json_serial, indent=4) else: @@ -421,37 +461,25 @@ class Entity(): if "_mastopy_type" not in json_result: raise ValueError("JSON does not contain _mastopy_type field, refusing to parse.") mastopy_type = json_result["_mastopy_type"] - - # See if we need to parse a sub-type (i.e. [] in the type name - sub_type = None - if "[" in mastopy_type and "]" in mastopy_type: - mastopy_type, sub_type = mastopy_type.split("[") - sub_type = sub_type[:-1] - if mastopy_type not in ["PaginatableList", "NonPaginatableList", "typing.Optional", "typing.Union"]: - raise ValueError(f"Subtype not allowed for type {mastopy_type} and subtype {sub_type}") - if "[" in mastopy_type or "]" in mastopy_type: - raise ValueError(f"Invalid type {mastopy_type}") - if sub_type is not None and ("[" in sub_type or "]" in sub_type): - raise ValueError(f"Invalid subtype {sub_type}") - - # Build the actual type object. - from mastodon.return_types import ENTITY_NAME_MAP - full_type = None - if sub_type is not None: - sub_type = ENTITY_NAME_MAP.get(sub_type, None) - full_type = { - "PaginatableList": PaginatableList[sub_type], - "NonPaginatableList": NonPaginatableList[sub_type], - "typing.Optional": Optional[sub_type], - "typing.Union": Union[sub_type], - }[mastopy_type] - else: - full_type = ENTITY_NAME_MAP.get(mastopy_type, None) - if full_type is None: - raise ValueError(f"Unknown type {mastopy_type}") + full_type = _str_to_type(mastopy_type) # Finally, try to cast to the generated type - return try_cast_recurse(full_type, json_result["_mastopy_data"]) + return_data = try_cast_recurse(full_type, json_result["_mastopy_data"]) + + # Fill in pagination information if it is present in the persisted data + if "_mastopy_extra_data" in json_result: + if "_pagination_next" in json_result["_mastopy_extra_data"]: + return_data._pagination_next = try_cast_recurse(PaginationInfo, json_result["_mastopy_extra_data"]["_pagination_next"]) + response_type = return_data._pagination_next.get("_mastopy_type", None) + if response_type is not None: + return_data._pagination_next["_mastopy_type"] = _str_to_type(response_type) + if "_pagination_prev" in json_result["_mastopy_extra_data"]: + return_data._pagination_prev = try_cast_recurse(PaginationInfo, json_result["_mastopy_extra_data"]["_pagination_prev"]) + response_type = return_data._pagination_prev.get("_mastopy_type", None) + if response_type is not None: + return_data._pagination_prev["_mastopy_type"] = _str_to_type(response_type) + + return return_data class PaginationInfo(OrderedDict): diff --git a/mastodon/utility.py b/mastodon/utility.py index 53dff34..594545b 100644 --- a/mastodon/utility.py +++ b/mastodon/utility.py @@ -151,14 +151,19 @@ class Mastodon(Internals): endpoint = params['_pagination_endpoint'] del params['_pagination_endpoint'] + response_type = None + if '_mastopy_type' in params: + response_type = params['_mastopy_type'] + del params['_mastopy_type'] + force_pagination = False if not isinstance(previous_page, list): force_pagination = True if not is_pagination_dict: - return self.__api_request(method, endpoint, params, force_pagination=force_pagination, override_type=type(previous_page)) + return self.__api_request(method, endpoint, params, force_pagination=force_pagination, override_type=response_type) else: - return self.__api_request(method, endpoint, params) + return self.__api_request(method, endpoint, params, override_type=response_type) def fetch_previous(self, next_page: Union[PaginatableList[Entity], Entity, Dict]) -> Optional[Union[PaginatableList[Entity], Entity]]: """ @@ -193,14 +198,19 @@ class Mastodon(Internals): endpoint = params['_pagination_endpoint'] del params['_pagination_endpoint'] + response_type = None + if '_mastopy_type' in params: + response_type = params['_mastopy_type'] + del params['_mastopy_type'] + force_pagination = False if not isinstance(next_page, list): force_pagination = True if not is_pagination_dict: - return self.__api_request(method, endpoint, params, force_pagination=force_pagination, override_type=type(next_page)) + return self.__api_request(method, endpoint, params, force_pagination=force_pagination, override_type=response_type) else: - return self.__api_request(method, endpoint, params) + return self.__api_request(method, endpoint, params, override_type=response_type) def fetch_remaining(self, first_page: PaginatableList[Entity]) -> PaginatableList[Entity]: """ diff --git a/tests/cassettes/test_fetch_next_previous_after_persist.yaml b/tests/cassettes/test_fetch_next_previous_after_persist.yaml new file mode 100644 index 0000000..f0fe9eb --- /dev/null +++ b/tests/cassettes/test_fetch_next_previous_after_persist.yaml @@ -0,0 +1,1560 @@ +interactions: +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Authorization: + - Bearer __MASTODON_PY_TEST_ACCESS_TOKEN + Connection: + - keep-alive + User-Agent: + - tests/v311 + method: GET + uri: http://localhost:3000/api/v1/accounts/verify_credentials + response: + body: + string: '{"id":"114091919945885200","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":true,"bot":false,"discoverable":null,"indexable":false,"group":false,"created_at":"2025-03-02T00:00:00.000Z","note":"","url":"http://localhost:3000/@mastodonpy_test","uri":"http://localhost:3000/users/mastodonpy_test","avatar":"http://localhost:3000/avatars/original/missing.png","avatar_static":"http://localhost:3000/avatars/original/missing.png","header":"http://localhost:3000/headers/original/missing.png","header_static":"http://localhost:3000/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":30,"last_status_at":"2025-03-02","hide_collections":null,"noindex":false,"source":{"privacy":"private","sensitive":false,"language":null,"note":"","fields":[],"follow_requests_count":0,"hide_collections":null,"discoverable":null,"indexable":false},"emojis":[],"roles":[],"fields":[],"role":{"id":"-99","name":"","permissions":"65536","color":"","highlighted":false}}' + headers: + Cache-Control: + - private, no-store + Content-Length: + - '1011' + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none'; form-action 'none' + Content-Type: + - application/json; charset=utf-8 + ETag: + - W/"9fde1cd548e612dc5ac19a670008ccd7" + Referrer-Policy: + - strict-origin-when-cross-origin + Server-Timing: + - cache_read.active_support;dur=0.11, sql.active_record;dur=5.10, cache_generate.active_support;dur=18.45, + cache_write.active_support;dur=0.30, instantiation.active_record;dur=1.76, + start_processing.action_controller;dur=0.00, render.active_model_serializers;dur=15.37, + process_action.action_controller;dur=45.84 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - SAMEORIGIN + X-Permitted-Cross-Domain-Policies: + - none + X-RateLimit-Limit: + - '300' + X-RateLimit-Remaining: + - '299' + X-RateLimit-Reset: + - '2025-03-02T09:15:00.329091Z' + X-Request-Id: + - 79627fa6-bb90-46d7-870d-f2638a3c7985 + X-Runtime: + - '0.088544' + X-XSS-Protection: + - '0' + vary: + - Authorization, Origin + 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: + - tests/v311 + method: POST + uri: http://localhost:3000/api/v1/statuses + response: + body: + string: '{"id":"114092063157185540","created_at":"2025-03-02T09:12:05.422Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"private","language":"ja","uri":"http://localhost:3000/users/mastodonpy_test/statuses/114092063157185540","url":"http://localhost:3000/@mastodonpy_test/114092063157185540","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 + number 0!\u003c/p\u003e","filtered":[],"reblog":null,"application":{"name":"Mastodon.py + test suite","website":null},"account":{"id":"114091919945885200","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":true,"bot":false,"discoverable":null,"indexable":false,"group":false,"created_at":"2025-03-02T00:00:00.000Z","note":"","url":"http://localhost:3000/@mastodonpy_test","uri":"http://localhost:3000/users/mastodonpy_test","avatar":"http://localhost:3000/avatars/original/missing.png","avatar_static":"http://localhost:3000/avatars/original/missing.png","header":"http://localhost:3000/headers/original/missing.png","header_static":"http://localhost:3000/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":31,"last_status_at":"2025-03-02","hide_collections":null,"noindex":false,"emojis":[],"roles":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null}' + headers: + Cache-Control: + - private, no-store + Content-Length: + - '1491' + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none'; form-action 'none' + Content-Type: + - application/json; charset=utf-8 + ETag: + - W/"14752b3b5fecb09817c2e3039dc65d7e" + Referrer-Policy: + - strict-origin-when-cross-origin + Server-Timing: + - cache_read.active_support;dur=0.06, sql.active_record;dur=16.04, cache_generate.active_support;dur=4.86, + cache_write.active_support;dur=0.21, instantiation.active_record;dur=0.94, + start_processing.action_controller;dur=0.00, transaction.active_record;dur=16.04, + render.active_model_serializers;dur=16.40, process_action.action_controller;dur=73.70 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - SAMEORIGIN + X-Permitted-Cross-Domain-Policies: + - none + X-RateLimit-Limit: + - '300' + X-RateLimit-Remaining: + - '289' + X-RateLimit-Reset: + - '2025-03-02T12:00:00.465173Z' + X-Request-Id: + - 51dd3908-1d6d-4ddb-af6b-d9f60b5c630c + X-Runtime: + - '0.095399' + X-XSS-Protection: + - '0' + vary: + - Authorization, Origin + 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: + - tests/v311 + method: POST + uri: http://localhost:3000/api/v1/statuses + response: + body: + string: '{"id":"114092063164774302","created_at":"2025-03-02T09:12:05.538Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"private","language":"ja","uri":"http://localhost:3000/users/mastodonpy_test/statuses/114092063164774302","url":"http://localhost:3000/@mastodonpy_test/114092063164774302","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 + number 1!\u003c/p\u003e","filtered":[],"reblog":null,"application":{"name":"Mastodon.py + test suite","website":null},"account":{"id":"114091919945885200","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":true,"bot":false,"discoverable":null,"indexable":false,"group":false,"created_at":"2025-03-02T00:00:00.000Z","note":"","url":"http://localhost:3000/@mastodonpy_test","uri":"http://localhost:3000/users/mastodonpy_test","avatar":"http://localhost:3000/avatars/original/missing.png","avatar_static":"http://localhost:3000/avatars/original/missing.png","header":"http://localhost:3000/headers/original/missing.png","header_static":"http://localhost:3000/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":32,"last_status_at":"2025-03-02","hide_collections":null,"noindex":false,"emojis":[],"roles":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null}' + headers: + Cache-Control: + - private, no-store + Content-Length: + - '1491' + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none'; form-action 'none' + Content-Type: + - application/json; charset=utf-8 + ETag: + - W/"80a368e9b681285e274e80e1058583e9" + Referrer-Policy: + - strict-origin-when-cross-origin + Server-Timing: + - cache_read.active_support;dur=0.05, sql.active_record;dur=11.45, cache_generate.active_support;dur=5.76, + cache_write.active_support;dur=0.17, instantiation.active_record;dur=0.61, + start_processing.action_controller;dur=0.00, transaction.active_record;dur=5.56, + render.active_model_serializers;dur=36.10, process_action.action_controller;dur=76.00 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - SAMEORIGIN + X-Permitted-Cross-Domain-Policies: + - none + X-RateLimit-Limit: + - '300' + X-RateLimit-Remaining: + - '288' + X-RateLimit-Reset: + - '2025-03-02T12:00:00.587789Z' + X-Request-Id: + - d7a8bf4a-7051-4550-b027-4bad57f6d70c + X-Runtime: + - '0.094163' + X-XSS-Protection: + - '0' + vary: + - Authorization, Origin + 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: + - tests/v311 + method: POST + uri: http://localhost:3000/api/v1/statuses + response: + body: + string: '{"id":"114092063172688153","created_at":"2025-03-02T09:12:05.658Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"private","language":"ja","uri":"http://localhost:3000/users/mastodonpy_test/statuses/114092063172688153","url":"http://localhost:3000/@mastodonpy_test/114092063172688153","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 + number 2!\u003c/p\u003e","filtered":[],"reblog":null,"application":{"name":"Mastodon.py + test suite","website":null},"account":{"id":"114091919945885200","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":true,"bot":false,"discoverable":null,"indexable":false,"group":false,"created_at":"2025-03-02T00:00:00.000Z","note":"","url":"http://localhost:3000/@mastodonpy_test","uri":"http://localhost:3000/users/mastodonpy_test","avatar":"http://localhost:3000/avatars/original/missing.png","avatar_static":"http://localhost:3000/avatars/original/missing.png","header":"http://localhost:3000/headers/original/missing.png","header_static":"http://localhost:3000/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":33,"last_status_at":"2025-03-02","hide_collections":null,"noindex":false,"emojis":[],"roles":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null}' + headers: + Cache-Control: + - private, no-store + Content-Length: + - '1491' + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none'; form-action 'none' + Content-Type: + - application/json; charset=utf-8 + ETag: + - W/"372d5e478e16acc034f142b4cc73a7f1" + Referrer-Policy: + - strict-origin-when-cross-origin + Server-Timing: + - cache_read.active_support;dur=0.05, sql.active_record;dur=11.52, cache_generate.active_support;dur=3.67, + cache_write.active_support;dur=0.14, instantiation.active_record;dur=0.66, + start_processing.action_controller;dur=0.00, transaction.active_record;dur=5.25, + render.active_model_serializers;dur=12.41, process_action.action_controller;dur=51.52 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - SAMEORIGIN + X-Permitted-Cross-Domain-Policies: + - none + X-RateLimit-Limit: + - '300' + X-RateLimit-Remaining: + - '287' + X-RateLimit-Reset: + - '2025-03-02T12:00:00.683891Z' + X-Request-Id: + - e8876854-7cfd-4747-be3e-3392546fdb89 + X-Runtime: + - '0.067564' + X-XSS-Protection: + - '0' + vary: + - Authorization, Origin + 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: + - tests/v311 + method: POST + uri: http://localhost:3000/api/v1/statuses + response: + body: + string: '{"id":"114092063178695970","created_at":"2025-03-02T09:12:05.750Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"private","language":"ja","uri":"http://localhost:3000/users/mastodonpy_test/statuses/114092063178695970","url":"http://localhost:3000/@mastodonpy_test/114092063178695970","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 + number 3!\u003c/p\u003e","filtered":[],"reblog":null,"application":{"name":"Mastodon.py + test suite","website":null},"account":{"id":"114091919945885200","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":true,"bot":false,"discoverable":null,"indexable":false,"group":false,"created_at":"2025-03-02T00:00:00.000Z","note":"","url":"http://localhost:3000/@mastodonpy_test","uri":"http://localhost:3000/users/mastodonpy_test","avatar":"http://localhost:3000/avatars/original/missing.png","avatar_static":"http://localhost:3000/avatars/original/missing.png","header":"http://localhost:3000/headers/original/missing.png","header_static":"http://localhost:3000/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":34,"last_status_at":"2025-03-02","hide_collections":null,"noindex":false,"emojis":[],"roles":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null}' + headers: + Cache-Control: + - private, no-store + Content-Length: + - '1491' + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none'; form-action 'none' + Content-Type: + - application/json; charset=utf-8 + ETag: + - W/"7abd829a07f61d277b0306452b259080" + Referrer-Policy: + - strict-origin-when-cross-origin + Server-Timing: + - cache_read.active_support;dur=0.04, sql.active_record;dur=10.42, cache_generate.active_support;dur=2.81, + cache_write.active_support;dur=0.13, instantiation.active_record;dur=0.49, + start_processing.action_controller;dur=0.00, transaction.active_record;dur=4.54, + render.active_model_serializers;dur=9.95, process_action.action_controller;dur=45.58 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - SAMEORIGIN + X-Permitted-Cross-Domain-Policies: + - none + X-RateLimit-Limit: + - '300' + X-RateLimit-Remaining: + - '286' + X-RateLimit-Reset: + - '2025-03-02T12:00:00.772961Z' + X-Request-Id: + - d68123af-aee5-486f-b070-6f3cca36da6e + X-Runtime: + - '0.060183' + X-XSS-Protection: + - '0' + vary: + - Authorization, Origin + 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: + - tests/v311 + method: POST + uri: http://localhost:3000/api/v1/statuses + response: + body: + string: '{"id":"114092063184588383","created_at":"2025-03-02T09:12:05.840Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"private","language":"ja","uri":"http://localhost:3000/users/mastodonpy_test/statuses/114092063184588383","url":"http://localhost:3000/@mastodonpy_test/114092063184588383","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 + number 4!\u003c/p\u003e","filtered":[],"reblog":null,"application":{"name":"Mastodon.py + test suite","website":null},"account":{"id":"114091919945885200","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":true,"bot":false,"discoverable":null,"indexable":false,"group":false,"created_at":"2025-03-02T00:00:00.000Z","note":"","url":"http://localhost:3000/@mastodonpy_test","uri":"http://localhost:3000/users/mastodonpy_test","avatar":"http://localhost:3000/avatars/original/missing.png","avatar_static":"http://localhost:3000/avatars/original/missing.png","header":"http://localhost:3000/headers/original/missing.png","header_static":"http://localhost:3000/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":35,"last_status_at":"2025-03-02","hide_collections":null,"noindex":false,"emojis":[],"roles":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null}' + headers: + Cache-Control: + - private, no-store + Content-Length: + - '1491' + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none'; form-action 'none' + Content-Type: + - application/json; charset=utf-8 + ETag: + - W/"7c3a3e378db93cb1c81ccca2e7adcfac" + Referrer-Policy: + - strict-origin-when-cross-origin + Server-Timing: + - cache_read.active_support;dur=0.05, sql.active_record;dur=10.52, cache_generate.active_support;dur=3.45, + cache_write.active_support;dur=0.14, instantiation.active_record;dur=0.51, + start_processing.action_controller;dur=0.00, transaction.active_record;dur=4.58, + render.active_model_serializers;dur=14.91, process_action.action_controller;dur=49.49 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - SAMEORIGIN + X-Permitted-Cross-Domain-Policies: + - none + X-RateLimit-Limit: + - '300' + X-RateLimit-Remaining: + - '285' + X-RateLimit-Reset: + - '2025-03-02T12:00:00.867109Z' + X-Request-Id: + - 0ba45be4-ba2d-475a-84ca-78a1afe1689d + X-Runtime: + - '0.064545' + X-XSS-Protection: + - '0' + vary: + - Authorization, Origin + 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: + - tests/v311 + method: POST + uri: http://localhost:3000/api/v1/statuses + response: + body: + string: '{"id":"114092063190860206","created_at":"2025-03-02T09:12:05.934Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"private","language":"ja","uri":"http://localhost:3000/users/mastodonpy_test/statuses/114092063190860206","url":"http://localhost:3000/@mastodonpy_test/114092063190860206","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 + number 5!\u003c/p\u003e","filtered":[],"reblog":null,"application":{"name":"Mastodon.py + test suite","website":null},"account":{"id":"114091919945885200","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":true,"bot":false,"discoverable":null,"indexable":false,"group":false,"created_at":"2025-03-02T00:00:00.000Z","note":"","url":"http://localhost:3000/@mastodonpy_test","uri":"http://localhost:3000/users/mastodonpy_test","avatar":"http://localhost:3000/avatars/original/missing.png","avatar_static":"http://localhost:3000/avatars/original/missing.png","header":"http://localhost:3000/headers/original/missing.png","header_static":"http://localhost:3000/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":36,"last_status_at":"2025-03-02","hide_collections":null,"noindex":false,"emojis":[],"roles":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null}' + headers: + Cache-Control: + - private, no-store + Content-Length: + - '1491' + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none'; form-action 'none' + Content-Type: + - application/json; charset=utf-8 + ETag: + - W/"ba8de644fcdd3765362cbb99ce7c0a25" + Referrer-Policy: + - strict-origin-when-cross-origin + Server-Timing: + - cache_read.active_support;dur=0.05, sql.active_record;dur=10.00, cache_generate.active_support;dur=2.81, + cache_write.active_support;dur=0.13, instantiation.active_record;dur=0.72, + start_processing.action_controller;dur=0.00, transaction.active_record;dur=4.09, + render.active_model_serializers;dur=10.48, process_action.action_controller;dur=44.47 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - SAMEORIGIN + X-Permitted-Cross-Domain-Policies: + - none + X-RateLimit-Limit: + - '300' + X-RateLimit-Remaining: + - '284' + X-RateLimit-Reset: + - '2025-03-02T12:00:00.956516Z' + X-Request-Id: + - 38474c2b-601f-4607-acf3-00edd4cf960c + X-Runtime: + - '0.059283' + X-XSS-Protection: + - '0' + vary: + - Authorization, Origin + 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: + - tests/v311 + method: POST + uri: http://localhost:3000/api/v1/statuses + response: + body: + string: '{"id":"114092063196584457","created_at":"2025-03-02T09:12:06.022Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"private","language":"ja","uri":"http://localhost:3000/users/mastodonpy_test/statuses/114092063196584457","url":"http://localhost:3000/@mastodonpy_test/114092063196584457","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 + number 6!\u003c/p\u003e","filtered":[],"reblog":null,"application":{"name":"Mastodon.py + test suite","website":null},"account":{"id":"114091919945885200","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":true,"bot":false,"discoverable":null,"indexable":false,"group":false,"created_at":"2025-03-02T00:00:00.000Z","note":"","url":"http://localhost:3000/@mastodonpy_test","uri":"http://localhost:3000/users/mastodonpy_test","avatar":"http://localhost:3000/avatars/original/missing.png","avatar_static":"http://localhost:3000/avatars/original/missing.png","header":"http://localhost:3000/headers/original/missing.png","header_static":"http://localhost:3000/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":37,"last_status_at":"2025-03-02","hide_collections":null,"noindex":false,"emojis":[],"roles":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null}' + headers: + Cache-Control: + - private, no-store + Content-Length: + - '1491' + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none'; form-action 'none' + Content-Type: + - application/json; charset=utf-8 + ETag: + - W/"8bd2b1221d085393ad6fb1a49d39e732" + Referrer-Policy: + - strict-origin-when-cross-origin + Server-Timing: + - cache_read.active_support;dur=0.05, sql.active_record;dur=10.04, cache_generate.active_support;dur=2.90, + cache_write.active_support;dur=0.13, instantiation.active_record;dur=0.46, + start_processing.action_controller;dur=0.00, transaction.active_record;dur=4.55, + render.active_model_serializers;dur=11.17, process_action.action_controller;dur=45.17 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - SAMEORIGIN + X-Permitted-Cross-Domain-Policies: + - none + X-RateLimit-Limit: + - '300' + X-RateLimit-Remaining: + - '283' + X-RateLimit-Reset: + - '2025-03-02T12:00:00.045590Z' + X-Request-Id: + - 6b62a85d-1dc0-4fcb-ab14-17cf19a5888d + X-Runtime: + - '0.059436' + X-XSS-Protection: + - '0' + vary: + - Authorization, Origin + 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: + - tests/v311 + method: POST + uri: http://localhost:3000/api/v1/statuses + response: + body: + string: '{"id":"114092063202496228","created_at":"2025-03-02T09:12:06.113Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"private","language":"ja","uri":"http://localhost:3000/users/mastodonpy_test/statuses/114092063202496228","url":"http://localhost:3000/@mastodonpy_test/114092063202496228","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 + number 7!\u003c/p\u003e","filtered":[],"reblog":null,"application":{"name":"Mastodon.py + test suite","website":null},"account":{"id":"114091919945885200","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":true,"bot":false,"discoverable":null,"indexable":false,"group":false,"created_at":"2025-03-02T00:00:00.000Z","note":"","url":"http://localhost:3000/@mastodonpy_test","uri":"http://localhost:3000/users/mastodonpy_test","avatar":"http://localhost:3000/avatars/original/missing.png","avatar_static":"http://localhost:3000/avatars/original/missing.png","header":"http://localhost:3000/headers/original/missing.png","header_static":"http://localhost:3000/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":38,"last_status_at":"2025-03-02","hide_collections":null,"noindex":false,"emojis":[],"roles":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null}' + headers: + Cache-Control: + - private, no-store + Content-Length: + - '1491' + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none'; form-action 'none' + Content-Type: + - application/json; charset=utf-8 + ETag: + - W/"e8c93e29e27b0eb0e76e052db3b4caa1" + Referrer-Policy: + - strict-origin-when-cross-origin + Server-Timing: + - cache_read.active_support;dur=0.05, sql.active_record;dur=10.17, cache_generate.active_support;dur=3.12, + cache_write.active_support;dur=0.14, instantiation.active_record;dur=0.50, + start_processing.action_controller;dur=0.00, transaction.active_record;dur=4.21, + render.active_model_serializers;dur=14.88, process_action.action_controller;dur=49.96 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - SAMEORIGIN + X-Permitted-Cross-Domain-Policies: + - none + X-RateLimit-Limit: + - '300' + X-RateLimit-Remaining: + - '282' + X-RateLimit-Reset: + - '2025-03-02T12:00:00.140176Z' + X-Request-Id: + - 88923bee-7d84-4eeb-a7d7-09dd40871770 + X-Runtime: + - '0.064632' + X-XSS-Protection: + - '0' + vary: + - Authorization, Origin + 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: + - tests/v311 + method: POST + uri: http://localhost:3000/api/v1/statuses + response: + body: + string: '{"id":"114092063208780921","created_at":"2025-03-02T09:12:06.208Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"private","language":"ja","uri":"http://localhost:3000/users/mastodonpy_test/statuses/114092063208780921","url":"http://localhost:3000/@mastodonpy_test/114092063208780921","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 + number 8!\u003c/p\u003e","filtered":[],"reblog":null,"application":{"name":"Mastodon.py + test suite","website":null},"account":{"id":"114091919945885200","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":true,"bot":false,"discoverable":null,"indexable":false,"group":false,"created_at":"2025-03-02T00:00:00.000Z","note":"","url":"http://localhost:3000/@mastodonpy_test","uri":"http://localhost:3000/users/mastodonpy_test","avatar":"http://localhost:3000/avatars/original/missing.png","avatar_static":"http://localhost:3000/avatars/original/missing.png","header":"http://localhost:3000/headers/original/missing.png","header_static":"http://localhost:3000/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":39,"last_status_at":"2025-03-02","hide_collections":null,"noindex":false,"emojis":[],"roles":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null}' + headers: + Cache-Control: + - private, no-store + Content-Length: + - '1491' + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none'; form-action 'none' + Content-Type: + - application/json; charset=utf-8 + ETag: + - W/"06f6bde895518a1b65e8d3dcb7a006e5" + Referrer-Policy: + - strict-origin-when-cross-origin + Server-Timing: + - cache_read.active_support;dur=0.04, sql.active_record;dur=9.98, cache_generate.active_support;dur=2.70, + cache_write.active_support;dur=0.13, instantiation.active_record;dur=0.52, + start_processing.action_controller;dur=0.00, transaction.active_record;dur=4.67, + render.active_model_serializers;dur=10.16, process_action.action_controller;dur=45.64 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - SAMEORIGIN + X-Permitted-Cross-Domain-Policies: + - none + X-RateLimit-Limit: + - '300' + X-RateLimit-Remaining: + - '281' + X-RateLimit-Reset: + - '2025-03-02T12:00:00.230944Z' + X-Request-Id: + - f1ebee74-45c1-4e12-a9df-ba43894e2e89 + X-Runtime: + - '0.060278' + X-XSS-Protection: + - '0' + vary: + - Authorization, Origin + 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: + - tests/v311 + method: POST + uri: http://localhost:3000/api/v1/statuses + response: + body: + string: '{"id":"114092063214587924","created_at":"2025-03-02T09:12:06.297Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"private","language":"ja","uri":"http://localhost:3000/users/mastodonpy_test/statuses/114092063214587924","url":"http://localhost:3000/@mastodonpy_test/114092063214587924","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 + number 9!\u003c/p\u003e","filtered":[],"reblog":null,"application":{"name":"Mastodon.py + test suite","website":null},"account":{"id":"114091919945885200","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":true,"bot":false,"discoverable":null,"indexable":false,"group":false,"created_at":"2025-03-02T00:00:00.000Z","note":"","url":"http://localhost:3000/@mastodonpy_test","uri":"http://localhost:3000/users/mastodonpy_test","avatar":"http://localhost:3000/avatars/original/missing.png","avatar_static":"http://localhost:3000/avatars/original/missing.png","header":"http://localhost:3000/headers/original/missing.png","header_static":"http://localhost:3000/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":40,"last_status_at":"2025-03-02","hide_collections":null,"noindex":false,"emojis":[],"roles":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null}' + headers: + Cache-Control: + - private, no-store + Content-Length: + - '1491' + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none'; form-action 'none' + Content-Type: + - application/json; charset=utf-8 + ETag: + - W/"e16c07db2d009fad5f6f83c0630188a6" + Referrer-Policy: + - strict-origin-when-cross-origin + Server-Timing: + - cache_read.active_support;dur=0.05, sql.active_record;dur=10.28, cache_generate.active_support;dur=2.73, + cache_write.active_support;dur=0.13, instantiation.active_record;dur=0.47, + start_processing.action_controller;dur=0.00, transaction.active_record;dur=4.49, + render.active_model_serializers;dur=9.52, process_action.action_controller;dur=44.15 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - SAMEORIGIN + X-Permitted-Cross-Domain-Policies: + - none + X-RateLimit-Limit: + - '300' + X-RateLimit-Remaining: + - '280' + X-RateLimit-Reset: + - '2025-03-02T12:00:00.319031Z' + X-Request-Id: + - 1392f7a0-7598-41e2-b2a2-183e8a482419 + X-Runtime: + - '0.058516' + X-XSS-Protection: + - '0' + vary: + - Authorization, Origin + 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: + - tests/v311 + method: GET + uri: http://localhost:3000/api/v1/accounts/114091919945885200/statuses?limit=5 + response: + body: + string: '[{"id":"114092063214587924","created_at":"2025-03-02T09:12:06.297Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"private","language":"ja","uri":"http://localhost:3000/users/mastodonpy_test/statuses/114092063214587924","url":"http://localhost:3000/@mastodonpy_test/114092063214587924","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 + number 9!\u003c/p\u003e","filtered":[],"reblog":null,"application":{"name":"Mastodon.py + test suite","website":null},"account":{"id":"114091919945885200","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":true,"bot":false,"discoverable":null,"indexable":false,"group":false,"created_at":"2025-03-02T00:00:00.000Z","note":"","url":"http://localhost:3000/@mastodonpy_test","uri":"http://localhost:3000/users/mastodonpy_test","avatar":"http://localhost:3000/avatars/original/missing.png","avatar_static":"http://localhost:3000/avatars/original/missing.png","header":"http://localhost:3000/headers/original/missing.png","header_static":"http://localhost:3000/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":40,"last_status_at":"2025-03-02","hide_collections":null,"noindex":false,"emojis":[],"roles":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null},{"id":"114092063208780921","created_at":"2025-03-02T09:12:06.208Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"private","language":"ja","uri":"http://localhost:3000/users/mastodonpy_test/statuses/114092063208780921","url":"http://localhost:3000/@mastodonpy_test/114092063208780921","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 + number 8!\u003c/p\u003e","filtered":[],"reblog":null,"application":{"name":"Mastodon.py + test suite","website":null},"account":{"id":"114091919945885200","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":true,"bot":false,"discoverable":null,"indexable":false,"group":false,"created_at":"2025-03-02T00:00:00.000Z","note":"","url":"http://localhost:3000/@mastodonpy_test","uri":"http://localhost:3000/users/mastodonpy_test","avatar":"http://localhost:3000/avatars/original/missing.png","avatar_static":"http://localhost:3000/avatars/original/missing.png","header":"http://localhost:3000/headers/original/missing.png","header_static":"http://localhost:3000/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":40,"last_status_at":"2025-03-02","hide_collections":null,"noindex":false,"emojis":[],"roles":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null},{"id":"114092063202496228","created_at":"2025-03-02T09:12:06.113Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"private","language":"ja","uri":"http://localhost:3000/users/mastodonpy_test/statuses/114092063202496228","url":"http://localhost:3000/@mastodonpy_test/114092063202496228","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 + number 7!\u003c/p\u003e","filtered":[],"reblog":null,"application":{"name":"Mastodon.py + test suite","website":null},"account":{"id":"114091919945885200","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":true,"bot":false,"discoverable":null,"indexable":false,"group":false,"created_at":"2025-03-02T00:00:00.000Z","note":"","url":"http://localhost:3000/@mastodonpy_test","uri":"http://localhost:3000/users/mastodonpy_test","avatar":"http://localhost:3000/avatars/original/missing.png","avatar_static":"http://localhost:3000/avatars/original/missing.png","header":"http://localhost:3000/headers/original/missing.png","header_static":"http://localhost:3000/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":40,"last_status_at":"2025-03-02","hide_collections":null,"noindex":false,"emojis":[],"roles":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null},{"id":"114092063196584457","created_at":"2025-03-02T09:12:06.022Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"private","language":"ja","uri":"http://localhost:3000/users/mastodonpy_test/statuses/114092063196584457","url":"http://localhost:3000/@mastodonpy_test/114092063196584457","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 + number 6!\u003c/p\u003e","filtered":[],"reblog":null,"application":{"name":"Mastodon.py + test suite","website":null},"account":{"id":"114091919945885200","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":true,"bot":false,"discoverable":null,"indexable":false,"group":false,"created_at":"2025-03-02T00:00:00.000Z","note":"","url":"http://localhost:3000/@mastodonpy_test","uri":"http://localhost:3000/users/mastodonpy_test","avatar":"http://localhost:3000/avatars/original/missing.png","avatar_static":"http://localhost:3000/avatars/original/missing.png","header":"http://localhost:3000/headers/original/missing.png","header_static":"http://localhost:3000/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":40,"last_status_at":"2025-03-02","hide_collections":null,"noindex":false,"emojis":[],"roles":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null},{"id":"114092063190860206","created_at":"2025-03-02T09:12:05.934Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"private","language":"ja","uri":"http://localhost:3000/users/mastodonpy_test/statuses/114092063190860206","url":"http://localhost:3000/@mastodonpy_test/114092063190860206","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 + number 5!\u003c/p\u003e","filtered":[],"reblog":null,"application":{"name":"Mastodon.py + test suite","website":null},"account":{"id":"114091919945885200","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":true,"bot":false,"discoverable":null,"indexable":false,"group":false,"created_at":"2025-03-02T00:00:00.000Z","note":"","url":"http://localhost:3000/@mastodonpy_test","uri":"http://localhost:3000/users/mastodonpy_test","avatar":"http://localhost:3000/avatars/original/missing.png","avatar_static":"http://localhost:3000/avatars/original/missing.png","header":"http://localhost:3000/headers/original/missing.png","header_static":"http://localhost:3000/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":40,"last_status_at":"2025-03-02","hide_collections":null,"noindex":false,"emojis":[],"roles":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null}]' + headers: + Cache-Control: + - private, no-store + Content-Length: + - '7461' + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none'; form-action 'none' + Content-Type: + - application/json; charset=utf-8 + ETag: + - W/"58a22ddccb21ffd559565634035c5473" + Link: + - ; + rel="next", ; + rel="prev" + Referrer-Policy: + - strict-origin-when-cross-origin + Server-Timing: + - cache_read.active_support;dur=0.16, sql.active_record;dur=3.32, cache_generate.active_support;dur=5.73, + cache_write.active_support;dur=0.13, instantiation.active_record;dur=0.73, + start_processing.action_controller;dur=0.00, cache_fetch_hit.active_support;dur=0.01, + render.active_model_serializers;dur=10.94, process_action.action_controller;dur=46.03 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - SAMEORIGIN + X-Permitted-Cross-Domain-Policies: + - none + X-RateLimit-Limit: + - '300' + X-RateLimit-Remaining: + - '299' + X-RateLimit-Reset: + - '2025-03-02T09:15:00.380068Z' + X-Request-Id: + - cf9c3653-008c-4072-82db-345a200582cf + X-Runtime: + - '0.060480' + X-XSS-Protection: + - '0' + vary: + - Authorization, Origin + 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: + - tests/v311 + method: GET + uri: http://localhost:3000/api/v1/accounts/114091919945885200/statuses?limit=5&max_id=114092063190860206 + response: + body: + string: '[{"id":"114092063184588383","created_at":"2025-03-02T09:12:05.840Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"private","language":"ja","uri":"http://localhost:3000/users/mastodonpy_test/statuses/114092063184588383","url":"http://localhost:3000/@mastodonpy_test/114092063184588383","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 + number 4!\u003c/p\u003e","filtered":[],"reblog":null,"application":{"name":"Mastodon.py + test suite","website":null},"account":{"id":"114091919945885200","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":true,"bot":false,"discoverable":null,"indexable":false,"group":false,"created_at":"2025-03-02T00:00:00.000Z","note":"","url":"http://localhost:3000/@mastodonpy_test","uri":"http://localhost:3000/users/mastodonpy_test","avatar":"http://localhost:3000/avatars/original/missing.png","avatar_static":"http://localhost:3000/avatars/original/missing.png","header":"http://localhost:3000/headers/original/missing.png","header_static":"http://localhost:3000/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":40,"last_status_at":"2025-03-02","hide_collections":null,"noindex":false,"emojis":[],"roles":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null},{"id":"114092063178695970","created_at":"2025-03-02T09:12:05.750Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"private","language":"ja","uri":"http://localhost:3000/users/mastodonpy_test/statuses/114092063178695970","url":"http://localhost:3000/@mastodonpy_test/114092063178695970","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 + number 3!\u003c/p\u003e","filtered":[],"reblog":null,"application":{"name":"Mastodon.py + test suite","website":null},"account":{"id":"114091919945885200","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":true,"bot":false,"discoverable":null,"indexable":false,"group":false,"created_at":"2025-03-02T00:00:00.000Z","note":"","url":"http://localhost:3000/@mastodonpy_test","uri":"http://localhost:3000/users/mastodonpy_test","avatar":"http://localhost:3000/avatars/original/missing.png","avatar_static":"http://localhost:3000/avatars/original/missing.png","header":"http://localhost:3000/headers/original/missing.png","header_static":"http://localhost:3000/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":40,"last_status_at":"2025-03-02","hide_collections":null,"noindex":false,"emojis":[],"roles":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null},{"id":"114092063172688153","created_at":"2025-03-02T09:12:05.658Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"private","language":"ja","uri":"http://localhost:3000/users/mastodonpy_test/statuses/114092063172688153","url":"http://localhost:3000/@mastodonpy_test/114092063172688153","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 + number 2!\u003c/p\u003e","filtered":[],"reblog":null,"application":{"name":"Mastodon.py + test suite","website":null},"account":{"id":"114091919945885200","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":true,"bot":false,"discoverable":null,"indexable":false,"group":false,"created_at":"2025-03-02T00:00:00.000Z","note":"","url":"http://localhost:3000/@mastodonpy_test","uri":"http://localhost:3000/users/mastodonpy_test","avatar":"http://localhost:3000/avatars/original/missing.png","avatar_static":"http://localhost:3000/avatars/original/missing.png","header":"http://localhost:3000/headers/original/missing.png","header_static":"http://localhost:3000/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":40,"last_status_at":"2025-03-02","hide_collections":null,"noindex":false,"emojis":[],"roles":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null},{"id":"114092063164774302","created_at":"2025-03-02T09:12:05.538Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"private","language":"ja","uri":"http://localhost:3000/users/mastodonpy_test/statuses/114092063164774302","url":"http://localhost:3000/@mastodonpy_test/114092063164774302","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 + number 1!\u003c/p\u003e","filtered":[],"reblog":null,"application":{"name":"Mastodon.py + test suite","website":null},"account":{"id":"114091919945885200","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":true,"bot":false,"discoverable":null,"indexable":false,"group":false,"created_at":"2025-03-02T00:00:00.000Z","note":"","url":"http://localhost:3000/@mastodonpy_test","uri":"http://localhost:3000/users/mastodonpy_test","avatar":"http://localhost:3000/avatars/original/missing.png","avatar_static":"http://localhost:3000/avatars/original/missing.png","header":"http://localhost:3000/headers/original/missing.png","header_static":"http://localhost:3000/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":40,"last_status_at":"2025-03-02","hide_collections":null,"noindex":false,"emojis":[],"roles":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null},{"id":"114092063157185540","created_at":"2025-03-02T09:12:05.422Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"private","language":"ja","uri":"http://localhost:3000/users/mastodonpy_test/statuses/114092063157185540","url":"http://localhost:3000/@mastodonpy_test/114092063157185540","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 + number 0!\u003c/p\u003e","filtered":[],"reblog":null,"application":{"name":"Mastodon.py + test suite","website":null},"account":{"id":"114091919945885200","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":true,"bot":false,"discoverable":null,"indexable":false,"group":false,"created_at":"2025-03-02T00:00:00.000Z","note":"","url":"http://localhost:3000/@mastodonpy_test","uri":"http://localhost:3000/users/mastodonpy_test","avatar":"http://localhost:3000/avatars/original/missing.png","avatar_static":"http://localhost:3000/avatars/original/missing.png","header":"http://localhost:3000/headers/original/missing.png","header_static":"http://localhost:3000/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":40,"last_status_at":"2025-03-02","hide_collections":null,"noindex":false,"emojis":[],"roles":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null}]' + headers: + Cache-Control: + - private, no-store + Content-Length: + - '7461' + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none'; form-action 'none' + Content-Type: + - application/json; charset=utf-8 + ETag: + - W/"626ad1958810b79e5752c29d699fdbe5" + Link: + - ; + rel="next", ; + rel="prev" + Referrer-Policy: + - strict-origin-when-cross-origin + Server-Timing: + - cache_read.active_support;dur=0.15, sql.active_record;dur=3.38, cache_generate.active_support;dur=3.78, + cache_write.active_support;dur=0.15, instantiation.active_record;dur=0.69, + start_processing.action_controller;dur=0.00, cache_fetch_hit.active_support;dur=0.01, + render.active_model_serializers;dur=11.16, process_action.action_controller;dur=43.70 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - SAMEORIGIN + X-Permitted-Cross-Domain-Policies: + - none + X-RateLimit-Limit: + - '300' + X-RateLimit-Remaining: + - '299' + X-RateLimit-Reset: + - '2025-03-02T09:15:00.964782Z' + X-Request-Id: + - b463861b-1c91-47fc-937e-e72ce53b0ade + X-Runtime: + - '0.059187' + X-XSS-Protection: + - '0' + vary: + - Authorization, Origin + 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: + - tests/v311 + method: GET + uri: http://localhost:3000/api/v1/accounts/114091919945885200/statuses?limit=5&min_id=114092063184588383 + response: + body: + string: '[{"id":"114092063214587924","created_at":"2025-03-02T09:12:06.297Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"private","language":"ja","uri":"http://localhost:3000/users/mastodonpy_test/statuses/114092063214587924","url":"http://localhost:3000/@mastodonpy_test/114092063214587924","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 + number 9!\u003c/p\u003e","filtered":[],"reblog":null,"application":{"name":"Mastodon.py + test suite","website":null},"account":{"id":"114091919945885200","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":true,"bot":false,"discoverable":null,"indexable":false,"group":false,"created_at":"2025-03-02T00:00:00.000Z","note":"","url":"http://localhost:3000/@mastodonpy_test","uri":"http://localhost:3000/users/mastodonpy_test","avatar":"http://localhost:3000/avatars/original/missing.png","avatar_static":"http://localhost:3000/avatars/original/missing.png","header":"http://localhost:3000/headers/original/missing.png","header_static":"http://localhost:3000/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":40,"last_status_at":"2025-03-02","hide_collections":null,"noindex":false,"emojis":[],"roles":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null},{"id":"114092063208780921","created_at":"2025-03-02T09:12:06.208Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"private","language":"ja","uri":"http://localhost:3000/users/mastodonpy_test/statuses/114092063208780921","url":"http://localhost:3000/@mastodonpy_test/114092063208780921","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 + number 8!\u003c/p\u003e","filtered":[],"reblog":null,"application":{"name":"Mastodon.py + test suite","website":null},"account":{"id":"114091919945885200","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":true,"bot":false,"discoverable":null,"indexable":false,"group":false,"created_at":"2025-03-02T00:00:00.000Z","note":"","url":"http://localhost:3000/@mastodonpy_test","uri":"http://localhost:3000/users/mastodonpy_test","avatar":"http://localhost:3000/avatars/original/missing.png","avatar_static":"http://localhost:3000/avatars/original/missing.png","header":"http://localhost:3000/headers/original/missing.png","header_static":"http://localhost:3000/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":40,"last_status_at":"2025-03-02","hide_collections":null,"noindex":false,"emojis":[],"roles":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null},{"id":"114092063202496228","created_at":"2025-03-02T09:12:06.113Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"private","language":"ja","uri":"http://localhost:3000/users/mastodonpy_test/statuses/114092063202496228","url":"http://localhost:3000/@mastodonpy_test/114092063202496228","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 + number 7!\u003c/p\u003e","filtered":[],"reblog":null,"application":{"name":"Mastodon.py + test suite","website":null},"account":{"id":"114091919945885200","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":true,"bot":false,"discoverable":null,"indexable":false,"group":false,"created_at":"2025-03-02T00:00:00.000Z","note":"","url":"http://localhost:3000/@mastodonpy_test","uri":"http://localhost:3000/users/mastodonpy_test","avatar":"http://localhost:3000/avatars/original/missing.png","avatar_static":"http://localhost:3000/avatars/original/missing.png","header":"http://localhost:3000/headers/original/missing.png","header_static":"http://localhost:3000/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":40,"last_status_at":"2025-03-02","hide_collections":null,"noindex":false,"emojis":[],"roles":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null},{"id":"114092063196584457","created_at":"2025-03-02T09:12:06.022Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"private","language":"ja","uri":"http://localhost:3000/users/mastodonpy_test/statuses/114092063196584457","url":"http://localhost:3000/@mastodonpy_test/114092063196584457","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 + number 6!\u003c/p\u003e","filtered":[],"reblog":null,"application":{"name":"Mastodon.py + test suite","website":null},"account":{"id":"114091919945885200","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":true,"bot":false,"discoverable":null,"indexable":false,"group":false,"created_at":"2025-03-02T00:00:00.000Z","note":"","url":"http://localhost:3000/@mastodonpy_test","uri":"http://localhost:3000/users/mastodonpy_test","avatar":"http://localhost:3000/avatars/original/missing.png","avatar_static":"http://localhost:3000/avatars/original/missing.png","header":"http://localhost:3000/headers/original/missing.png","header_static":"http://localhost:3000/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":40,"last_status_at":"2025-03-02","hide_collections":null,"noindex":false,"emojis":[],"roles":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null},{"id":"114092063190860206","created_at":"2025-03-02T09:12:05.934Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"private","language":"ja","uri":"http://localhost:3000/users/mastodonpy_test/statuses/114092063190860206","url":"http://localhost:3000/@mastodonpy_test/114092063190860206","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 + number 5!\u003c/p\u003e","filtered":[],"reblog":null,"application":{"name":"Mastodon.py + test suite","website":null},"account":{"id":"114091919945885200","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":true,"bot":false,"discoverable":null,"indexable":false,"group":false,"created_at":"2025-03-02T00:00:00.000Z","note":"","url":"http://localhost:3000/@mastodonpy_test","uri":"http://localhost:3000/users/mastodonpy_test","avatar":"http://localhost:3000/avatars/original/missing.png","avatar_static":"http://localhost:3000/avatars/original/missing.png","header":"http://localhost:3000/headers/original/missing.png","header_static":"http://localhost:3000/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":40,"last_status_at":"2025-03-02","hide_collections":null,"noindex":false,"emojis":[],"roles":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null}]' + headers: + Cache-Control: + - private, no-store + Content-Length: + - '7461' + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none'; form-action 'none' + Content-Type: + - application/json; charset=utf-8 + ETag: + - W/"58a22ddccb21ffd559565634035c5473" + Link: + - ; + rel="next", ; + rel="prev" + Referrer-Policy: + - strict-origin-when-cross-origin + Server-Timing: + - cache_read.active_support;dur=0.18, sql.active_record;dur=3.13, cache_generate.active_support;dur=2.85, + cache_write.active_support;dur=0.17, instantiation.active_record;dur=0.68, + start_processing.action_controller;dur=0.00, cache_fetch_hit.active_support;dur=0.01, + render.active_model_serializers;dur=11.32, process_action.action_controller;dur=42.94 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - SAMEORIGIN + X-Permitted-Cross-Domain-Policies: + - none + X-RateLimit-Limit: + - '300' + X-RateLimit-Remaining: + - '299' + X-RateLimit-Reset: + - '2025-03-02T09:15:00.160305Z' + X-Request-Id: + - 9eae3e14-5390-40ce-bf44-d251d3a234b5 + X-Runtime: + - '0.058617' + X-XSS-Protection: + - '0' + vary: + - Authorization, Origin + 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: + - tests/v311 + method: DELETE + uri: http://localhost:3000/api/v1/statuses/114092063157185540 + response: + body: + string: '{"id":"114092063157185540","created_at":"2025-03-02T09:12:05.422Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"private","language":"ja","uri":"http://localhost:3000/users/mastodonpy_test/statuses/114092063157185540","url":"http://localhost:3000/@mastodonpy_test/114092063157185540","replies_count":0,"reblogs_count":0,"favourites_count":0,"edited_at":null,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"pinned":false,"text":"Toot + number 0!","filtered":[],"reblog":null,"application":{"name":"Mastodon.py + test suite","website":null},"account":{"id":"114091919945885200","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":true,"bot":false,"discoverable":null,"indexable":false,"group":false,"created_at":"2025-03-02T00:00:00.000Z","note":"","url":"http://localhost:3000/@mastodonpy_test","uri":"http://localhost:3000/users/mastodonpy_test","avatar":"http://localhost:3000/avatars/original/missing.png","avatar_static":"http://localhost:3000/avatars/original/missing.png","header":"http://localhost:3000/headers/original/missing.png","header_static":"http://localhost:3000/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":39,"last_status_at":"2025-03-02","hide_collections":null,"noindex":false,"emojis":[],"roles":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null}' + headers: + Cache-Control: + - private, no-store + Content-Length: + - '1461' + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none'; form-action 'none' + Content-Type: + - application/json; charset=utf-8 + ETag: + - W/"869b626f601bde7c50f7a2bf788c4cd1" + Referrer-Policy: + - strict-origin-when-cross-origin + Server-Timing: + - cache_read.active_support;dur=0.05, sql.active_record;dur=6.34, cache_generate.active_support;dur=2.87, + cache_write.active_support;dur=0.15, instantiation.active_record;dur=0.83, + start_processing.action_controller;dur=0.00, transaction.active_record;dur=3.33, + render.active_model_serializers;dur=14.99, process_action.action_controller;dur=61.32 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - SAMEORIGIN + X-Permitted-Cross-Domain-Policies: + - none + X-RateLimit-Limit: + - '30' + X-RateLimit-Remaining: + - '29' + X-RateLimit-Reset: + - '2025-03-02T09:30:00.359068Z' + X-Request-Id: + - 9c2b77e3-275f-4231-a382-a904ca7d227a + X-Runtime: + - '0.079425' + X-XSS-Protection: + - '0' + vary: + - Authorization, Origin + 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: + - tests/v311 + method: DELETE + uri: http://localhost:3000/api/v1/statuses/114092063164774302 + response: + body: + string: '{"id":"114092063164774302","created_at":"2025-03-02T09:12:05.538Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"private","language":"ja","uri":"http://localhost:3000/users/mastodonpy_test/statuses/114092063164774302","url":"http://localhost:3000/@mastodonpy_test/114092063164774302","replies_count":0,"reblogs_count":0,"favourites_count":0,"edited_at":null,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"pinned":false,"text":"Toot + number 1!","filtered":[],"reblog":null,"application":{"name":"Mastodon.py + test suite","website":null},"account":{"id":"114091919945885200","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":true,"bot":false,"discoverable":null,"indexable":false,"group":false,"created_at":"2025-03-02T00:00:00.000Z","note":"","url":"http://localhost:3000/@mastodonpy_test","uri":"http://localhost:3000/users/mastodonpy_test","avatar":"http://localhost:3000/avatars/original/missing.png","avatar_static":"http://localhost:3000/avatars/original/missing.png","header":"http://localhost:3000/headers/original/missing.png","header_static":"http://localhost:3000/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":39,"last_status_at":"2025-03-02","hide_collections":null,"noindex":false,"emojis":[],"roles":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null}' + headers: + Cache-Control: + - private, no-store + Content-Length: + - '1461' + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none'; form-action 'none' + Content-Type: + - application/json; charset=utf-8 + ETag: + - W/"143c2e95bc06275a1d415660cf86b24a" + Referrer-Policy: + - strict-origin-when-cross-origin + Server-Timing: + - cache_read.active_support;dur=0.05, sql.active_record;dur=5.93, cache_generate.active_support;dur=3.13, + cache_write.active_support;dur=0.15, instantiation.active_record;dur=0.73, + start_processing.action_controller;dur=0.00, transaction.active_record;dur=2.82, + render.active_model_serializers;dur=12.97, process_action.action_controller;dur=41.35 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - SAMEORIGIN + X-Permitted-Cross-Domain-Policies: + - none + X-RateLimit-Limit: + - '30' + X-RateLimit-Remaining: + - '29' + X-RateLimit-Reset: + - '2025-03-02T09:30:00.466369Z' + X-Request-Id: + - 8f8973d1-d982-44dd-bb66-cb90973f7614 + X-Runtime: + - '0.056832' + X-XSS-Protection: + - '0' + vary: + - Authorization, Origin + 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: + - tests/v311 + method: DELETE + uri: http://localhost:3000/api/v1/statuses/114092063172688153 + response: + body: + string: '{"id":"114092063172688153","created_at":"2025-03-02T09:12:05.658Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"private","language":"ja","uri":"http://localhost:3000/users/mastodonpy_test/statuses/114092063172688153","url":"http://localhost:3000/@mastodonpy_test/114092063172688153","replies_count":0,"reblogs_count":0,"favourites_count":0,"edited_at":null,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"pinned":false,"text":"Toot + number 2!","filtered":[],"reblog":null,"application":{"name":"Mastodon.py + test suite","website":null},"account":{"id":"114091919945885200","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":true,"bot":false,"discoverable":null,"indexable":false,"group":false,"created_at":"2025-03-02T00:00:00.000Z","note":"","url":"http://localhost:3000/@mastodonpy_test","uri":"http://localhost:3000/users/mastodonpy_test","avatar":"http://localhost:3000/avatars/original/missing.png","avatar_static":"http://localhost:3000/avatars/original/missing.png","header":"http://localhost:3000/headers/original/missing.png","header_static":"http://localhost:3000/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":39,"last_status_at":"2025-03-02","hide_collections":null,"noindex":false,"emojis":[],"roles":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null}' + headers: + Cache-Control: + - private, no-store + Content-Length: + - '1461' + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none'; form-action 'none' + Content-Type: + - application/json; charset=utf-8 + ETag: + - W/"5f357d210f2011cf86b72283f0864f58" + Referrer-Policy: + - strict-origin-when-cross-origin + Server-Timing: + - cache_read.active_support;dur=0.04, sql.active_record;dur=6.02, cache_generate.active_support;dur=2.90, + cache_write.active_support;dur=0.13, instantiation.active_record;dur=0.61, + start_processing.action_controller;dur=0.00, transaction.active_record;dur=3.46, + render.active_model_serializers;dur=13.50, process_action.action_controller;dur=43.93 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - SAMEORIGIN + X-Permitted-Cross-Domain-Policies: + - none + X-RateLimit-Limit: + - '30' + X-RateLimit-Remaining: + - '29' + X-RateLimit-Reset: + - '2025-03-02T09:30:00.552960Z' + X-Request-Id: + - 04f22718-0608-431a-bcbb-241c87a5ceba + X-Runtime: + - '0.058196' + X-XSS-Protection: + - '0' + vary: + - Authorization, Origin + 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: + - tests/v311 + method: DELETE + uri: http://localhost:3000/api/v1/statuses/114092063178695970 + response: + body: + string: '{"id":"114092063178695970","created_at":"2025-03-02T09:12:05.750Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"private","language":"ja","uri":"http://localhost:3000/users/mastodonpy_test/statuses/114092063178695970","url":"http://localhost:3000/@mastodonpy_test/114092063178695970","replies_count":0,"reblogs_count":0,"favourites_count":0,"edited_at":null,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"pinned":false,"text":"Toot + number 3!","filtered":[],"reblog":null,"application":{"name":"Mastodon.py + test suite","website":null},"account":{"id":"114091919945885200","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":true,"bot":false,"discoverable":null,"indexable":false,"group":false,"created_at":"2025-03-02T00:00:00.000Z","note":"","url":"http://localhost:3000/@mastodonpy_test","uri":"http://localhost:3000/users/mastodonpy_test","avatar":"http://localhost:3000/avatars/original/missing.png","avatar_static":"http://localhost:3000/avatars/original/missing.png","header":"http://localhost:3000/headers/original/missing.png","header_static":"http://localhost:3000/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":39,"last_status_at":"2025-03-02","hide_collections":null,"noindex":false,"emojis":[],"roles":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null}' + headers: + Cache-Control: + - private, no-store + Content-Length: + - '1461' + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none'; form-action 'none' + Content-Type: + - application/json; charset=utf-8 + ETag: + - W/"136e9d993e89c1da1366636445b54f6a" + Referrer-Policy: + - strict-origin-when-cross-origin + Server-Timing: + - cache_read.active_support;dur=0.05, sql.active_record;dur=6.15, cache_generate.active_support;dur=3.03, + cache_write.active_support;dur=0.14, instantiation.active_record;dur=0.63, + start_processing.action_controller;dur=0.00, transaction.active_record;dur=3.65, + render.active_model_serializers;dur=13.23, process_action.action_controller;dur=40.86 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - SAMEORIGIN + X-Permitted-Cross-Domain-Policies: + - none + X-RateLimit-Limit: + - '30' + X-RateLimit-Remaining: + - '29' + X-RateLimit-Reset: + - '2025-03-02T09:30:00.642914Z' + X-Request-Id: + - 44602e92-3394-4ee9-823f-3d1dfbd761d3 + X-Runtime: + - '0.055882' + X-XSS-Protection: + - '0' + vary: + - Authorization, Origin + 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: + - tests/v311 + method: DELETE + uri: http://localhost:3000/api/v1/statuses/114092063184588383 + response: + body: + string: '{"id":"114092063184588383","created_at":"2025-03-02T09:12:05.840Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"private","language":"ja","uri":"http://localhost:3000/users/mastodonpy_test/statuses/114092063184588383","url":"http://localhost:3000/@mastodonpy_test/114092063184588383","replies_count":0,"reblogs_count":0,"favourites_count":0,"edited_at":null,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"pinned":false,"text":"Toot + number 4!","filtered":[],"reblog":null,"application":{"name":"Mastodon.py + test suite","website":null},"account":{"id":"114091919945885200","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":true,"bot":false,"discoverable":null,"indexable":false,"group":false,"created_at":"2025-03-02T00:00:00.000Z","note":"","url":"http://localhost:3000/@mastodonpy_test","uri":"http://localhost:3000/users/mastodonpy_test","avatar":"http://localhost:3000/avatars/original/missing.png","avatar_static":"http://localhost:3000/avatars/original/missing.png","header":"http://localhost:3000/headers/original/missing.png","header_static":"http://localhost:3000/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":39,"last_status_at":"2025-03-02","hide_collections":null,"noindex":false,"emojis":[],"roles":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null}' + headers: + Cache-Control: + - private, no-store + Content-Length: + - '1461' + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none'; form-action 'none' + Content-Type: + - application/json; charset=utf-8 + ETag: + - W/"627d1e51c917b64cb765a717bdb51330" + Referrer-Policy: + - strict-origin-when-cross-origin + Server-Timing: + - cache_read.active_support;dur=0.05, sql.active_record;dur=6.05, cache_generate.active_support;dur=4.10, + cache_write.active_support;dur=0.15, instantiation.active_record;dur=0.65, + start_processing.action_controller;dur=0.00, transaction.active_record;dur=3.42, + render.active_model_serializers;dur=12.58, process_action.action_controller;dur=40.20 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - SAMEORIGIN + X-Permitted-Cross-Domain-Policies: + - none + X-RateLimit-Limit: + - '30' + X-RateLimit-Remaining: + - '29' + X-RateLimit-Reset: + - '2025-03-02T09:30:00.730916Z' + X-Request-Id: + - 1f71a530-94b3-4b02-aaa1-94064765090c + X-Runtime: + - '0.056082' + X-XSS-Protection: + - '0' + vary: + - Authorization, Origin + 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: + - tests/v311 + method: DELETE + uri: http://localhost:3000/api/v1/statuses/114092063190860206 + response: + body: + string: '{"id":"114092063190860206","created_at":"2025-03-02T09:12:05.934Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"private","language":"ja","uri":"http://localhost:3000/users/mastodonpy_test/statuses/114092063190860206","url":"http://localhost:3000/@mastodonpy_test/114092063190860206","replies_count":0,"reblogs_count":0,"favourites_count":0,"edited_at":null,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"pinned":false,"text":"Toot + number 5!","filtered":[],"reblog":null,"application":{"name":"Mastodon.py + test suite","website":null},"account":{"id":"114091919945885200","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":true,"bot":false,"discoverable":null,"indexable":false,"group":false,"created_at":"2025-03-02T00:00:00.000Z","note":"","url":"http://localhost:3000/@mastodonpy_test","uri":"http://localhost:3000/users/mastodonpy_test","avatar":"http://localhost:3000/avatars/original/missing.png","avatar_static":"http://localhost:3000/avatars/original/missing.png","header":"http://localhost:3000/headers/original/missing.png","header_static":"http://localhost:3000/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":39,"last_status_at":"2025-03-02","hide_collections":null,"noindex":false,"emojis":[],"roles":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null}' + headers: + Cache-Control: + - private, no-store + Content-Length: + - '1461' + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none'; form-action 'none' + Content-Type: + - application/json; charset=utf-8 + ETag: + - W/"7a34c23db275c2923e39750daf3bef20" + Referrer-Policy: + - strict-origin-when-cross-origin + Server-Timing: + - cache_read.active_support;dur=0.05, sql.active_record;dur=5.52, cache_generate.active_support;dur=2.83, + cache_write.active_support;dur=0.14, instantiation.active_record;dur=0.62, + start_processing.action_controller;dur=0.00, transaction.active_record;dur=2.79, + render.active_model_serializers;dur=13.01, process_action.action_controller;dur=43.48 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - SAMEORIGIN + X-Permitted-Cross-Domain-Policies: + - none + X-RateLimit-Limit: + - '30' + X-RateLimit-Remaining: + - '29' + X-RateLimit-Reset: + - '2025-03-02T09:30:00.819744Z' + X-Request-Id: + - 137616b5-55dc-47f5-8da7-e7c4b3fab250 + X-Runtime: + - '0.058001' + X-XSS-Protection: + - '0' + vary: + - Authorization, Origin + 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: + - tests/v311 + method: DELETE + uri: http://localhost:3000/api/v1/statuses/114092063196584457 + response: + body: + string: '{"id":"114092063196584457","created_at":"2025-03-02T09:12:06.022Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"private","language":"ja","uri":"http://localhost:3000/users/mastodonpy_test/statuses/114092063196584457","url":"http://localhost:3000/@mastodonpy_test/114092063196584457","replies_count":0,"reblogs_count":0,"favourites_count":0,"edited_at":null,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"pinned":false,"text":"Toot + number 6!","filtered":[],"reblog":null,"application":{"name":"Mastodon.py + test suite","website":null},"account":{"id":"114091919945885200","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":true,"bot":false,"discoverable":null,"indexable":false,"group":false,"created_at":"2025-03-02T00:00:00.000Z","note":"","url":"http://localhost:3000/@mastodonpy_test","uri":"http://localhost:3000/users/mastodonpy_test","avatar":"http://localhost:3000/avatars/original/missing.png","avatar_static":"http://localhost:3000/avatars/original/missing.png","header":"http://localhost:3000/headers/original/missing.png","header_static":"http://localhost:3000/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":39,"last_status_at":"2025-03-02","hide_collections":null,"noindex":false,"emojis":[],"roles":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null}' + headers: + Cache-Control: + - private, no-store + Content-Length: + - '1461' + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none'; form-action 'none' + Content-Type: + - application/json; charset=utf-8 + ETag: + - W/"923af1d9745e3d532cee2be40031239d" + Referrer-Policy: + - strict-origin-when-cross-origin + Server-Timing: + - cache_read.active_support;dur=0.05, sql.active_record;dur=5.74, cache_generate.active_support;dur=2.64, + cache_write.active_support;dur=0.14, instantiation.active_record;dur=0.66, + start_processing.action_controller;dur=0.00, transaction.active_record;dur=2.85, + render.active_model_serializers;dur=13.78, process_action.action_controller;dur=40.70 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - SAMEORIGIN + X-Permitted-Cross-Domain-Policies: + - none + X-RateLimit-Limit: + - '30' + X-RateLimit-Remaining: + - '29' + X-RateLimit-Reset: + - '2025-03-02T09:30:00.905108Z' + X-Request-Id: + - 3d01e9bc-8fb8-468c-a511-9d2ff4523eaf + X-Runtime: + - '0.055514' + X-XSS-Protection: + - '0' + vary: + - Authorization, Origin + 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: + - tests/v311 + method: DELETE + uri: http://localhost:3000/api/v1/statuses/114092063202496228 + response: + body: + string: '{"id":"114092063202496228","created_at":"2025-03-02T09:12:06.113Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"private","language":"ja","uri":"http://localhost:3000/users/mastodonpy_test/statuses/114092063202496228","url":"http://localhost:3000/@mastodonpy_test/114092063202496228","replies_count":0,"reblogs_count":0,"favourites_count":0,"edited_at":null,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"pinned":false,"text":"Toot + number 7!","filtered":[],"reblog":null,"application":{"name":"Mastodon.py + test suite","website":null},"account":{"id":"114091919945885200","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":true,"bot":false,"discoverable":null,"indexable":false,"group":false,"created_at":"2025-03-02T00:00:00.000Z","note":"","url":"http://localhost:3000/@mastodonpy_test","uri":"http://localhost:3000/users/mastodonpy_test","avatar":"http://localhost:3000/avatars/original/missing.png","avatar_static":"http://localhost:3000/avatars/original/missing.png","header":"http://localhost:3000/headers/original/missing.png","header_static":"http://localhost:3000/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":39,"last_status_at":"2025-03-02","hide_collections":null,"noindex":false,"emojis":[],"roles":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null}' + headers: + Cache-Control: + - private, no-store + Content-Length: + - '1461' + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none'; form-action 'none' + Content-Type: + - application/json; charset=utf-8 + ETag: + - W/"b0e516919ac3b8e3397eb61911a203a1" + Referrer-Policy: + - strict-origin-when-cross-origin + Server-Timing: + - cache_read.active_support;dur=0.04, sql.active_record;dur=5.65, cache_generate.active_support;dur=2.59, + cache_write.active_support;dur=0.14, instantiation.active_record;dur=0.62, + start_processing.action_controller;dur=0.00, transaction.active_record;dur=3.23, + render.active_model_serializers;dur=12.38, process_action.action_controller;dur=39.26 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - SAMEORIGIN + X-Permitted-Cross-Domain-Policies: + - none + X-RateLimit-Limit: + - '30' + X-RateLimit-Remaining: + - '29' + X-RateLimit-Reset: + - '2025-03-02T09:30:00.991543Z' + X-Request-Id: + - bcfcb95d-87b1-4f37-aa2b-68382a0c434c + X-Runtime: + - '0.054189' + X-XSS-Protection: + - '0' + vary: + - Authorization, Origin + 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: + - tests/v311 + method: DELETE + uri: http://localhost:3000/api/v1/statuses/114092063208780921 + response: + body: + string: '{"id":"114092063208780921","created_at":"2025-03-02T09:12:06.208Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"private","language":"ja","uri":"http://localhost:3000/users/mastodonpy_test/statuses/114092063208780921","url":"http://localhost:3000/@mastodonpy_test/114092063208780921","replies_count":0,"reblogs_count":0,"favourites_count":0,"edited_at":null,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"pinned":false,"text":"Toot + number 8!","filtered":[],"reblog":null,"application":{"name":"Mastodon.py + test suite","website":null},"account":{"id":"114091919945885200","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":true,"bot":false,"discoverable":null,"indexable":false,"group":false,"created_at":"2025-03-02T00:00:00.000Z","note":"","url":"http://localhost:3000/@mastodonpy_test","uri":"http://localhost:3000/users/mastodonpy_test","avatar":"http://localhost:3000/avatars/original/missing.png","avatar_static":"http://localhost:3000/avatars/original/missing.png","header":"http://localhost:3000/headers/original/missing.png","header_static":"http://localhost:3000/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":39,"last_status_at":"2025-03-02","hide_collections":null,"noindex":false,"emojis":[],"roles":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null}' + headers: + Cache-Control: + - private, no-store + Content-Length: + - '1461' + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none'; form-action 'none' + Content-Type: + - application/json; charset=utf-8 + ETag: + - W/"83ba90538001de473967f82d9c814467" + Referrer-Policy: + - strict-origin-when-cross-origin + Server-Timing: + - cache_read.active_support;dur=0.05, sql.active_record;dur=5.78, cache_generate.active_support;dur=2.95, + cache_write.active_support;dur=0.18, instantiation.active_record;dur=0.81, + start_processing.action_controller;dur=0.00, transaction.active_record;dur=3.40, + render.active_model_serializers;dur=13.59, process_action.action_controller;dur=41.87 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - SAMEORIGIN + X-Permitted-Cross-Domain-Policies: + - none + X-RateLimit-Limit: + - '30' + X-RateLimit-Remaining: + - '29' + X-RateLimit-Reset: + - '2025-03-02T09:30:00.079919Z' + X-Request-Id: + - f430945a-9dc6-471f-8231-4b0309573811 + X-Runtime: + - '0.059972' + X-XSS-Protection: + - '0' + vary: + - Authorization, Origin + 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: + - tests/v311 + method: DELETE + uri: http://localhost:3000/api/v1/statuses/114092063214587924 + response: + body: + string: '{"id":"114092063214587924","created_at":"2025-03-02T09:12:06.297Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"private","language":"ja","uri":"http://localhost:3000/users/mastodonpy_test/statuses/114092063214587924","url":"http://localhost:3000/@mastodonpy_test/114092063214587924","replies_count":0,"reblogs_count":0,"favourites_count":0,"edited_at":null,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"pinned":false,"text":"Toot + number 9!","filtered":[],"reblog":null,"application":{"name":"Mastodon.py + test suite","website":null},"account":{"id":"114091919945885200","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":true,"bot":false,"discoverable":null,"indexable":false,"group":false,"created_at":"2025-03-02T00:00:00.000Z","note":"","url":"http://localhost:3000/@mastodonpy_test","uri":"http://localhost:3000/users/mastodonpy_test","avatar":"http://localhost:3000/avatars/original/missing.png","avatar_static":"http://localhost:3000/avatars/original/missing.png","header":"http://localhost:3000/headers/original/missing.png","header_static":"http://localhost:3000/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":39,"last_status_at":"2025-03-02","hide_collections":null,"noindex":false,"emojis":[],"roles":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null}' + headers: + Cache-Control: + - private, no-store + Content-Length: + - '1461' + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none'; form-action 'none' + Content-Type: + - application/json; charset=utf-8 + ETag: + - W/"17c925745e14d39a2b1c04c156593539" + Referrer-Policy: + - strict-origin-when-cross-origin + Server-Timing: + - cache_read.active_support;dur=0.05, sql.active_record;dur=5.47, cache_generate.active_support;dur=2.63, + cache_write.active_support;dur=0.16, instantiation.active_record;dur=0.60, + start_processing.action_controller;dur=0.00, transaction.active_record;dur=3.19, + render.active_model_serializers;dur=12.29, process_action.action_controller;dur=39.44 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - SAMEORIGIN + X-Permitted-Cross-Domain-Policies: + - none + X-RateLimit-Limit: + - '30' + X-RateLimit-Remaining: + - '29' + X-RateLimit-Reset: + - '2025-03-02T09:30:00.166693Z' + X-Request-Id: + - 0cf8f8c3-a33a-45ff-8dc1-07349f36023d + X-Runtime: + - '0.053569' + X-XSS-Protection: + - '0' + vary: + - Authorization, Origin + status: + code: 200 + message: OK +version: 1 diff --git a/tests/conftest.py b/tests/conftest.py index f60d571..c81a584 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -3,7 +3,7 @@ import os import vcr # Set this to True to debug issues with tests -DEBUG_REQUESTS = True +DEBUG_REQUESTS = False def _api(access_token='__MASTODON_PY_TEST_ACCESS_TOKEN', version="4.3.0", version_check_mode="created"): import mastodon diff --git a/tests/test_pagination.py b/tests/test_pagination.py index b65ff60..b4408f7 100644 --- a/tests/test_pagination.py +++ b/tests/test_pagination.py @@ -11,6 +11,7 @@ import requests_mock UNLIKELY_HASHTAG = "fgiztsshwiaqqiztpmmjbtvmescsculuvmgjgopwoeidbcrixp" +from mastodon.types_base import Entity @contextmanager def many_statuses(api, n=10, suffix=''): @@ -30,9 +31,44 @@ def test_fetch_next_previous(api): statuses = api.account_statuses(account['id'], limit=5) next_statuses = api.fetch_next(statuses) assert next_statuses + assert type(next_statuses) == type(statuses) + for status in next_statuses: + assert status['id'] < statuses[0]['id'] + assert type(status) == type(statuses[0]) previous_statuses = api.fetch_previous(next_statuses) assert previous_statuses + assert type(previous_statuses) == type(statuses) + for status in previous_statuses: + assert status['id'] > next_statuses[-1]['id'] + assert type(status) == type(statuses[0]) +@pytest.mark.vcr() +def test_fetch_next_previous_after_persist(api): + account = api.account_verify_credentials() + with many_statuses(api): + statuses_orig = api.account_statuses(account['id'], limit=5) + statuses_persist_json = statuses_orig.to_json() + statuses = Entity.from_json(statuses_persist_json) + assert type(statuses) == type(statuses_orig) + assert type(statuses[0]) == type(statuses_orig[0]) + next_statuses = api.fetch_next(statuses) + assert next_statuses + assert type(next_statuses) == type(statuses) + for status in next_statuses: + assert status['id'] < statuses[0]['id'] + assert type(status) == type(statuses[0]) + persisted_next_json = next_statuses.to_json() + next_statuses = Entity.from_json(persisted_next_json) + assert type(next_statuses) == type(statuses) + for status in next_statuses: + assert status['id'] < statuses[0]['id'] + assert type(status) == type(statuses[0]) + previous_statuses = api.fetch_previous(next_statuses) + assert previous_statuses + assert type(previous_statuses) == type(statuses) + for status in previous_statuses: + assert status['id'] > next_statuses[-1]['id'] + assert type(status) == type(statuses[0]) @pytest.mark.vcr() def test_fetch_next_previous_from_pagination_info(api): @@ -41,8 +77,17 @@ def test_fetch_next_previous_from_pagination_info(api): statuses = api.account_statuses(account['id'], limit=5) next_statuses = api.fetch_next(statuses._pagination_next) assert next_statuses + assert type(next_statuses) == type(statuses) + for status in next_statuses: + assert status['id'] < statuses[0]['id'] + assert type(status) == type(statuses[0]) previous_statuses = api.fetch_previous(next_statuses._pagination_prev) assert previous_statuses + assert type(previous_statuses) == type(statuses) + for status in previous_statuses: + assert status['id'] > next_statuses[-1]['id'] + assert type(status) == type(statuses[0]) + @pytest.mark.vcr() def test_fetch_remaining(api3): @@ -51,6 +96,9 @@ def test_fetch_remaining(api3): hashtag_remaining = api3.fetch_remaining(hashtag) assert hashtag_remaining assert len(hashtag_remaining) >= 30 + for status in hashtag_remaining: + assert UNLIKELY_HASHTAG in status['content'] + assert type(status) == type(hashtag[0]) def test_link_headers(api): rmock = requests_mock.Adapter()