diff --git a/docs/02_return_values.rst b/docs/02_return_values.rst index 036bb66..a0fc0a6 100644 --- a/docs/02_return_values.rst +++ b/docs/02_return_values.rst @@ -346,6 +346,30 @@ Return types .. autoclass:: mastodon.return_types.AccountCreationErrorDetailsField :members: +.. autoclass:: mastodon.return_types.NotificationPolicy + :members: + +.. autoclass:: mastodon.return_types.NotificationPolicySummary + :members: + +.. autoclass:: mastodon.return_types.RelationshipSeveranceEvent + :members: + +.. autoclass:: mastodon.return_types.GroupedNotificationsResults + :members: + +.. autoclass:: mastodon.return_types.PartialAccountWithAvatar + :members: + +.. autoclass:: mastodon.return_types.NotificationGroup + :members: + +.. autoclass:: mastodon.return_types.AccountWarning + :members: + +.. autoclass:: mastodon.return_types.UnreadNotificationsCount + :members: + Deprecated types ================ .. autoclass:: mastodon.return_types.Filter @@ -356,4 +380,3 @@ Deprecated types .. autoclass:: mastodon.return_types.IdentityProof :members: - diff --git a/mastodon/return_types.py b/mastodon/return_types.py index 429239c..8ffc13e 100644 --- a/mastodon/return_types.py +++ b/mastodon/return_types.py @@ -285,6 +285,14 @@ class Account(AttribAccessDict): * 4.1.0: added """ + memorial: "bool" + """ + Boolean indicating whether the account is an in-memoriam account. + + Version history: + * 4.2.0: added + """ + _version = "4.2.0" class AccountField(AttribAccessDict): @@ -3361,7 +3369,15 @@ class InstanceRegistrations(AttribAccessDict): * 4.0.0: added """ - _version = "4.0.0" + sign_up_url: "Optional[str]" + """ + URL to the sign-up form for this instance. Only present for the v2 API variant of the instance API. (optional) + + Version history: + * 4.2.0: added + """ + + _version = "4.2.0" class InstanceContact(AttribAccessDict): """ @@ -4692,7 +4708,7 @@ class StreamReaction(AttribAccessDict): .. code-block:: python # Returns a StreamReaction object - TODO_TO_BE_IMPLEMENTED + # Only available via the streaming API See also (Mastodon API documentation): https://docs.joinmastodon.org/methods/streaming/ """ @@ -4896,7 +4912,7 @@ class AdminAccount(AttribAccessDict): sensitized: "bool" """ - Undocumented. If you know what this means, please let me know. + Boolean indicating whether the account has been marked as force-sensitive. Version history: * 2.9.1: added @@ -5315,7 +5331,7 @@ class AdminCanonicalEmailBlock(AttribAccessDict): .. code-block:: python # Returns a AdminCanonicalEmailBlock object - TODO_TO_BE_IMPLEMENTED + api2.admin_create_canonical_email_block(email=) See also (Mastodon API documentation): https://docs.joinmastodon.org/entities/Admin_CanonicalEmailBlock """ @@ -5695,7 +5711,7 @@ class IdentityProof(AttribAccessDict): .. code-block:: python # Returns a IdentityProof object - TODO_TO_BE_IMPLEMENTED + # Deprecated since 3.5.0 and eventually removed, there is no way to get this on current versions of Mastodon. See also (Mastodon API documentation): https://docs.joinmastodon.org/entities/IdentityProof """ @@ -5791,17 +5807,29 @@ class Suggestion(AttribAccessDict): .. code-block:: python # Returns a Suggestion object - TODO_TO_BE_IMPLEMENTED + mastodon.suggestions()[0] See also (Mastodon API documentation): https://docs.joinmastodon.org/entities/Suggestion """ source: "str" """ + THIS FIELD IS DEPRECATED. IT IS RECOMMENDED THAT YOU DO NOT USE IT. + The reason this account is being suggested. Version history: * 3.4.0: added + * 4.3.0: deprecated + """ + + sources: "NonPaginatableList[str]" + """ + The reasons this account is being suggested. + Should contain (as text): SuggestionSourceEnum + + Version history: + * 4.3.0: added """ account: "Account" @@ -5812,7 +5840,7 @@ class Suggestion(AttribAccessDict): * 3.4.0: added """ - _version = "3.4.0" + _version = "4.3.0" class Translation(AttribAccessDict): """ @@ -5982,6 +6010,503 @@ class AccountCreationErrorDetailsField(AttribAccessDict): _version = "3.4.0" +class NotificationPolicy(AttribAccessDict): + """ + Represents the notification filtering policy of the user. + + Example: + + .. code-block:: python + + # Returns a NotificationPolicy object + TODO_TO_BE_IMPLEMENTED + + See also (Mastodon API documentation): https://docs.joinmastodon.org/entities/NotificationPolicy + """ + + for_not_following: "str" + """ + Whether to accept, filter or drop notifications from accounts the user is not following. + + Version history: + * 4.3.0: added + """ + + for_not_followers: "str" + """ + Whether to accept, filter or drop notifications from accounts that are not following the user. + + Version history: + * 4.3.0: added + """ + + for_new_accounts: "str" + """ + Whether to accept, filter or drop notifications from accounts created in the past 30 days. + + Version history: + * 4.3.0: added + """ + + for_private_mentions: "str" + """ + Whether to accept, filter or drop notifications from private mentions. + + Version history: + * 4.3.0: added + """ + + for_limited_accounts: "str" + """ + Whether to accept, filter or drop notifications from accounts that were limited by a moderator. + + Version history: + * 4.3.0: added + """ + + summary: "NotificationPolicySummary" + """ + A summary of the filtered notifications. + + Version history: + * 4.3.0: added + """ + + _version = "4.3.0" + +class NotificationPolicySummary(AttribAccessDict): + """ + A summary of the filtered notifications. + + Example: + + .. code-block:: python + + # Returns a NotificationPolicySummary object + TODO_TO_BE_IMPLEMENTED + + See also (Mastodon API documentation): https://docs.joinmastodon.org/entities/NotificationPolicy + """ + + pending_requests_count: "int" + """ + Number of different accounts from which the user has non-dismissed filtered notifications. Capped at 100. + + Version history: + * 4.3.0: added + """ + + pending_notifications_count: "int" + """ + Number of total non-dismissed filtered notifications. May be inaccurate. + + Version history: + * 4.3.0: added + """ + + _version = "4.3.0" + +class RelationshipSeveranceEvent(AttribAccessDict): + """ + Summary of a moderation or block event that caused follow relationships to be severed. + + Example: + + .. code-block:: python + + # Returns a RelationshipSeveranceEvent object + TODO_TO_BE_IMPLEMENTED + + See also (Mastodon API documentation): https://docs.joinmastodon.org/entities/RelationshipSeveranceEvent + """ + + id: "str" + """ + The ID of the relationship severance event in the database. + + Version history: + * 4.3.0: added + """ + + type: "str" + """ + Type of event. + + Version history: + * 4.3.0: added + """ + + purged: "bool" + """ + Whether the list of severed relationships is unavailable because the data has been purged. + + Version history: + * 4.3.0: added + """ + + target_name: "str" + """ + Name of the target of the moderation/block event. This is either a domain name or a user handle, depending on the event type. + + Version history: + * 4.3.0: added + """ + + followers_count: "int" + """ + Number of followers that were removed as result of the event. + + Version history: + * 4.3.0: added + """ + + following_count: "int" + """ + Number of accounts the user stopped following as result of the event. + + Version history: + * 4.3.0: added + """ + + created_at: "datetime" + """ + When the event took place. + + Version history: + * 4.3.0: added + """ + + _version = "4.3.0" + +class GroupedNotificationsResults(AttribAccessDict): + """ + Container for grouped notifications plus referenced accounts and statuses. + + Example: + + .. code-block:: python + + # Returns a GroupedNotificationsResults object + TODO_TO_BE_IMPLEMENTED + + See also (Mastodon API documentation): https://docs.joinmastodon.org/entities/GroupedNotificationsResults + """ + + accounts: "NonPaginatableList[Account]" + """ + Accounts referenced by grouped notifications. + + Version history: + * 4.3.0: added + """ + + partial_accounts: "Optional[NonPaginatableList[PartialAccountWithAvatar]]" + """ + Partial accounts referenced by grouped notifications. Only returned with expand_accounts=partial_avatars. (optional) + + Version history: + * 4.3.0: added + """ + + statuses: "NonPaginatableList[Status]" + """ + Statuses referenced by grouped notifications. + + Version history: + * 4.3.0: added + """ + + notification_groups: "NonPaginatableList[NotificationGroup]" + """ + The grouped notifications themselves. + + Version history: + * 4.3.0: added + """ + + _version = "4.3.0" + +class PartialAccountWithAvatar(AttribAccessDict): + """ + A stripped-down version of Account, containing only what is necessary to display avatars and a few other fields. + + Example: + + .. code-block:: python + + # Returns a PartialAccountWithAvatar object + TODO_TO_BE_IMPLEMENTED + + See also (Mastodon API documentation): https://docs.joinmastodon.org/entities/GroupedNotificationsResults + """ + + id: "str" + """ + The account ID. + + Version history: + * 4.3.0: added + """ + + acct: "str" + """ + The Webfinger account URI. + + Version history: + * 4.3.0: added + """ + + url: "str" + """ + The location of the user’s profile page. + + Version history: + * 4.3.0: added + """ + + avatar: "str" + """ + An image icon (avatar) shown in the profile. + + Version history: + * 4.3.0: added + """ + + avatar_static: "str" + """ + A static version of the avatar. May differ if the main avatar is animated. + + Version history: + * 4.3.0: added + """ + + locked: "bool" + """ + Whether the account manually approves follow requests. + + Version history: + * 4.3.0: added + """ + + bot: "bool" + """ + Indicates that the account may perform automated actions. + + Version history: + * 4.3.0: added + """ + + _version = "4.3.0" + +class NotificationGroup(AttribAccessDict): + """ + A group of related notifications, plus metadata for pagination. + + Example: + + .. code-block:: python + + # Returns a NotificationGroup object + TODO_TO_BE_IMPLEMENTED + + See also (Mastodon API documentation): https://docs.joinmastodon.org/entities/GroupedNotificationsResults + """ + + group_key: "str" + """ + Group key identifying the grouped notifications. Treated as opaque. + + Version history: + * 4.3.0: added + """ + + notifications_count: "int" + """ + Total number of individual notifications in this group. + + Version history: + * 4.3.0: added + """ + + type: "str" + """ + The type of event that resulted in the notifications. + Should contain (as text): NotificationTypeEnum + + Version history: + * 4.3.0: added + """ + + most_recent_notification_id: "str" + """ + ID of the most recent notification in the group. + + Version history: + * 4.3.0: added + """ + + page_min_id: "Optional[str]" + """ + ID of the oldest notification in this group within the current page. (optional) + + Version history: + * 4.3.0: added + """ + + page_max_id: "Optional[str]" + """ + ID of the newest notification in this group within the current page. (optional) + + Version history: + * 4.3.0: added + """ + + latest_page_notification_at: "Optional[datetime]" + """ + Date at which the most recent notification within this group (in the current page) was created. (optional) + + Version history: + * 4.3.0: added + """ + + sample_account_ids: "NonPaginatableList[str]" + """ + IDs of some of the accounts who most recently triggered notifications in this group. + + Version history: + * 4.3.0: added + """ + + status_id: "Optional[str]" + """ + ID of the Status that was the object of the notification. (optional) + + Version history: + * 4.3.0: added + """ + + report: "Optional[Report]" + """ + Report that was the object of the notification. (optional) + + Version history: + * 4.3.0: added + """ + + event: "Optional[RelationshipSeveranceEvent]" + """ + Summary of the event that caused follow relationships to be severed. (optional) + + Version history: + * 4.3.0: added + """ + + moderation_warning: "Optional[AccountWarning]" + """ + Moderation warning that caused the notification. (optional) + + Version history: + * 4.3.0: added + """ + + _version = "4.3.0" + +class AccountWarning(AttribAccessDict): + """ + Moderation warning against a particular account. + + Example: + + .. code-block:: python + + # Returns a AccountWarning object + TODO_TO_BE_IMPLEMENTED + + See also (Mastodon API documentation): https://docs.joinmastodon.org/entities/AccountWarning + """ + + id: "str" + """ + The ID of the account warning in the database. + + Version history: + * 4.3.0: added + """ + + action: "str" + """ + Action taken against the account. + + Version history: + * 4.3.0: added + """ + + text: "str" + """ + Message from the moderator to the target account. + + Version history: + * 4.3.0: added + """ + + status_ids: "Optional[NonPaginatableList[str]]" + """ + List of status IDs relevant to the warning. May be null. (nullable) + + Version history: + * 4.3.0: added + """ + + target_account: "Account" + """ + Account against which a moderation decision has been taken. + + Version history: + * 4.3.0: added + """ + + appeal: "Optional[Appeal]" + """ + Appeal submitted by the target account, if any. (nullable) + + Version history: + * 4.3.0: added + """ + + created_at: "datetime" + """ + When the event took place. + + Version history: + * 4.3.0: added + """ + + _version = "4.3.0" + +class UnreadNotificationsCount(AttribAccessDict): + """ + Get the (capped) number of unread notifications for the current user. + + Example: + + .. code-block:: python + + # Returns a UnreadNotificationsCount object + TODO_TO_BE_IMPLEMENTED + + See also (Mastodon API documentation): https://docs.joinmastodon.org/methods/notifications/#unread_count + """ + + count: "int" + """ + The capped number of unread notifications. The cap is not documented. + + Version history: + * 4.3.0: added + """ + + _version = "4.3.0" + ENTITY_NAME_MAP = { "Account": Account, "AccountField": AccountField, @@ -6082,6 +6607,14 @@ ENTITY_NAME_MAP = { "AccountCreationError": AccountCreationError, "AccountCreationErrorDetails": AccountCreationErrorDetails, "AccountCreationErrorDetailsField": AccountCreationErrorDetailsField, + "NotificationPolicy": NotificationPolicy, + "NotificationPolicySummary": NotificationPolicySummary, + "RelationshipSeveranceEvent": RelationshipSeveranceEvent, + "GroupedNotificationsResults": GroupedNotificationsResults, + "PartialAccountWithAvatar": PartialAccountWithAvatar, + "NotificationGroup": NotificationGroup, + "AccountWarning": AccountWarning, + "UnreadNotificationsCount": UnreadNotificationsCount, } __all__ = [ "Account", @@ -6183,5 +6716,13 @@ __all__ = [ "AccountCreationError", "AccountCreationErrorDetails", "AccountCreationErrorDetailsField", + "NotificationPolicy", + "NotificationPolicySummary", + "RelationshipSeveranceEvent", + "GroupedNotificationsResults", + "PartialAccountWithAvatar", + "NotificationGroup", + "AccountWarning", + "UnreadNotificationsCount", ] diff --git a/mastodon/types_base.py b/mastodon/types_base.py index d9a3dda..dd42795 100644 --- a/mastodon/types_base.py +++ b/mastodon/types_base.py @@ -161,7 +161,9 @@ if sys.version_info < (3, 9): AdminMeasure, AdminMeasureData, AdminDimension, AdminDimensionData, AdminRetention, AdminCohort, \ AdminDomainBlock, AdminCanonicalEmailBlock, AdminDomainAllow, AdminEmailDomainBlock, AdminEmailDomainBlockHistory, AdminIpBlock, \ DomainBlock, ExtendedDescription, FilterKeyword, FilterStatus, IdentityProof, StatusSource, \ - Suggestion, Translation, AccountCreationError, AccountCreationErrorDetails, AccountCreationErrorDetailsField + Suggestion, Translation, AccountCreationError, AccountCreationErrorDetails, AccountCreationErrorDetailsField, NotificationPolicy, \ + NotificationPolicySummary, RelationshipSeveranceEvent, GroupedNotificationsResults, PartialAccountWithAvatar, NotificationGroup, AccountWarning, \ + UnreadNotificationsCount if isinstance(t, ForwardRef): try: t = t._evaluate(globals(), locals(), frozenset()) diff --git a/srcgen/return_types.json b/srcgen/return_types.json index 773a0bf..1a31426 100644 --- a/srcgen/return_types.json +++ b/srcgen/return_types.json @@ -8585,7 +8585,7 @@ "func_call_real": null, "func_call_additional": null, "func_alternate_acc": null, - "manual_update": false, + "manual_update": true, "is_deprecated": true, "masto_doc_link": "https://docs.joinmastodon.org/entities/IdentityProof", "description": "A cryptographic proof-of-identity. Deprecated since 3.5.0.", @@ -8728,7 +8728,7 @@ { "name": "Suggestion", "python_name": "Suggestion", - "func_call": "mastodon.suggestions()[0]", + "func_call": "mastodon.suggestions_v2()[0]", "func_call_real": null, "func_call_additional": null, "func_alternate_acc": null, diff --git a/tests/cassettes_entity_tests/test_entity_instance.yaml b/tests/cassettes_entity_tests/test_entity_instance.yaml index 01e52fc..8140287 100644 --- a/tests/cassettes_entity_tests/test_entity_instance.yaml +++ b/tests/cassettes_entity_tests/test_entity_instance.yaml @@ -20,7 +20,7 @@ interactions: "The original server operated by the Mastodon gGmbH non-profit", "description": "", "email": "staff@mastodon.social", "version": "4.4.0-nightly.2025-02-07", "urls": {"streaming_api": "wss://streaming.mastodon.social"}, "stats": {"user_count": - 2521623, "status_count": 120126443, "domain_count": 81755}, "thumbnail": "https://files.mastodon.social/site_uploads/files/000/000/001/@1x/57c12f441d083cde.png", + 2522485, "status_count": 120163210, "domain_count": 81770}, "thumbnail": "https://files.mastodon.social/site_uploads/files/000/000/001/@1x/57c12f441d083cde.png", "languages": ["en"], "registrations": true, "approval_required": false, "invites_enabled": true, "configuration": {"accounts": {"max_featured_tags": 10}, "statuses": {"max_characters": 500, "max_media_attachments": 4, "characters_reserved_per_url": @@ -41,8 +41,8 @@ interactions: "avatar_static": "https://files.mastodon.social/accounts/avatars/000/013/179/original/b4ceb19c9c54ec7e.png", "header": "https://files.mastodon.social/accounts/headers/000/013/179/original/1375be116fbe0f1d.png", "header_static": "https://files.mastodon.social/accounts/headers/000/013/179/original/1375be116fbe0f1d.png", - "followers_count": 837809, "following_count": 4, "statuses_count": 288, "last_status_at": - "2025-01-27", "hide_collections": false, "noindex": false, "emojis": [], "roles": + "followers_count": 837871, "following_count": 4, "statuses_count": 289, "last_status_at": + "2025-02-14", "hide_collections": false, "noindex": false, "emojis": [], "roles": [], "fields": [{"name": "Homepage", "value": "https://joinmastodon.org", @@ -84,11 +84,11 @@ interactions: Accept-Ranges: - bytes Age: - - '232' + - '220' Connection: - keep-alive Date: - - Fri, 14 Feb 2025 15:38:20 GMT + - Fri, 14 Feb 2025 22:39:45 GMT Strict-Transport-Security: - max-age=31557600 Vary: @@ -98,9 +98,9 @@ interactions: X-Cache-Hits: - 0, 5, 2 X-Served-By: - - cache-fra-eddf8230164-FRA, cache-fra-eddf8230152-FRA, cache-hel1410021-HEL + - cache-fra-eddf8230164-FRA, cache-fra-eddf8230152-FRA, cache-hel1410026-HEL X-Timer: - - S1739547500.398876,VS0,VE0 + - S1739572786.988993,VS0,VE0 alt-svc: - h3=":443";ma=86400,h3-29=":443";ma=86400,h3-27=":443";ma=86400 cache-control: @@ -112,7 +112,7 @@ interactions: content-type: - application/json; charset=utf-8 etag: - - W/"e83f947e4236ab50c372b04653b2c955" + - W/"bc38a058993fdbe29400795727e9d33c" referrer-policy: - same-origin via: @@ -124,13 +124,13 @@ interactions: x-ratelimit-limit: - '300' x-ratelimit-remaining: - - '173' + - '270' x-ratelimit-reset: - - '2025-02-14T15:35:00.651194Z' + - '2025-02-14T22:40:00.053698Z' x-request-id: - - 65e3ef547e7f34e6712a02c124593883 + - 8280556bb02fca4d6ed4a6da22529247 x-runtime: - - '0.266735' + - '0.032541' x-xss-protection: - '0' status: diff --git a/tests/cassettes_entity_tests/test_entity_instanceaccountconfiguration.yaml b/tests/cassettes_entity_tests/test_entity_instanceaccountconfiguration.yaml index 018a4dc..3276917 100644 --- a/tests/cassettes_entity_tests/test_entity_instanceaccountconfiguration.yaml +++ b/tests/cassettes_entity_tests/test_entity_instanceaccountconfiguration.yaml @@ -1,4 +1,141 @@ interactions: +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Authorization: + - DUMMY + Connection: + - keep-alive + User-Agent: + - mastodonpy + method: GET + uri: https://mastodon.social/api/v1/instance/ + response: + body: + string: '{"uri": "mastodon.social", "title": "Mastodon", "short_description": + "The original server operated by the Mastodon gGmbH non-profit", "description": + "", "email": "staff@mastodon.social", "version": "4.4.0-nightly.2025-02-07", + "urls": {"streaming_api": "wss://streaming.mastodon.social"}, "stats": {"user_count": + 2522485, "status_count": 120163210, "domain_count": 81770}, "thumbnail": "https://files.mastodon.social/site_uploads/files/000/000/001/@1x/57c12f441d083cde.png", + "languages": ["en"], "registrations": true, "approval_required": false, "invites_enabled": + true, "configuration": {"accounts": {"max_featured_tags": 10}, "statuses": + {"max_characters": 500, "max_media_attachments": 4, "characters_reserved_per_url": + 23}, "media_attachments": {"supported_mime_types": ["image/jpeg", "image/png", + "image/gif", "image/heic", "image/heif", "image/webp", "image/avif", "video/webm", + "video/mp4", "video/quicktime", "video/ogg", "audio/wave", "audio/wav", "audio/x-wav", + "audio/x-pn-wave", "audio/vnd.wave", "audio/ogg", "audio/vorbis", "audio/mpeg", + "audio/mp3", "audio/webm", "audio/flac", "audio/aac", "audio/m4a", "audio/x-m4a", + "audio/mp4", "audio/3gpp", "video/x-ms-asf"], "image_size_limit": 16777216, + "image_matrix_limit": 33177600, "video_size_limit": 103809024, "video_frame_rate_limit": + 120, "video_matrix_limit": 8294400}, "polls": {"max_options": 4, "max_characters_per_option": + 50, "min_expiration": 300, "max_expiration": 2629746}}, "contact_account": + {"id": "13179", "username": "Mastodon", "acct": "Mastodon", "display_name": + "Mastodon", "locked": false, "bot": false, "discoverable": true, "indexable": + false, "group": false, "created_at": "2016-11-23T00:00:00.000Z", "note": "

Free, + open-source decentralized social media platform.

", "url": "https://mastodon.social/@Mastodon", + "uri": "https://mastodon.social/users/Mastodon", "avatar": "https://files.mastodon.social/accounts/avatars/000/013/179/original/b4ceb19c9c54ec7e.png", + "avatar_static": "https://files.mastodon.social/accounts/avatars/000/013/179/original/b4ceb19c9c54ec7e.png", + "header": "https://files.mastodon.social/accounts/headers/000/013/179/original/1375be116fbe0f1d.png", + "header_static": "https://files.mastodon.social/accounts/headers/000/013/179/original/1375be116fbe0f1d.png", + "followers_count": 837871, "following_count": 4, "statuses_count": 289, "last_status_at": + "2025-02-14", "hide_collections": false, "noindex": false, "emojis": [], "roles": + [], "fields": [{"name": "Homepage", "value": "https://joinmastodon.org", + "verified_at": "2018-10-31T04:11:00.076+00:00"}, {"name": "Patreon", "value": + "https://patreon.com/mastodon", + "verified_at": null}, {"name": "GitHub", "value": "https://github.com/mastodon", + "verified_at": "2023-07-21T13:27:45.996+00:00"}]}, "rules": [{"id": "1", "text": + "Sexually explicit or violent media must be marked as sensitive or with a + content warning", "hint": "This includes content that is particularly provocative + even if it may not show specific body parts, as well as dead bodies, bloody + injuries, and other gore. Particularly obscene content may be prohibited entirely. + Profile pictures and header images may not contain sexually explicit or violent + media."}, {"id": "2", "text": "No racism, sexism, homophobia, transphobia, + ableism, xenophobia, or casteism.", "hint": "Transphobic behavior such as + intentional misgendering and deadnaming is strictly prohibited. Promotion + of \"conversion therapy\" is strictly prohibited. Criticism of governments + and religions is permissible unless being used as a proxy for discrimination."}, + {"id": "3", "text": "No incitement of violence or promotion of violent ideologies", + "hint": "Calling for people or groups to be assassinated, murdered, or attacked + physically is strictly prohibited. Support for violent groups or events is + prohibited."}, {"id": "4", "text": "No harassment, block evasion, dogpiling, + or doxxing of others", "hint": "Repeat attempts to communicate with users + who have blocked you or creation of accounts solely to harass or insult individuals + is strictly prohibited. Coordinated activity to attack other users is prohibited. + Posting of private personal information about others is prohibited."}, {"id": + "7", "text": "Do not share information widely-known to be false and misleading", + "hint": "False and misleading information and links from low-quality sources + may not be posted, especially if they are likely to mislead or confuse others + or endanger their safety."}, {"id": "1008", "text": "Content created by others + must be attributed, and use of generative AI must be disclosed", "hint": "Content + created by others must clearly provide a reference to the author, creator, + or source. For adult content, this should include performers. Accounts may + not solely post AI-generated content."}]}' + headers: + Accept-Ranges: + - bytes + Age: + - '221' + Connection: + - keep-alive + Date: + - Fri, 14 Feb 2025 22:39:47 GMT + Strict-Transport-Security: + - max-age=31557600 + Vary: + - Accept, Origin, Accept-Encoding + X-Cache: + - MISS, HIT, HIT + X-Cache-Hits: + - 0, 5, 2 + X-Served-By: + - cache-fra-eddf8230164-FRA, cache-fra-eddf8230152-FRA, cache-hel1410025-HEL + X-Timer: + - S1739572788.768476,VS0,VE0 + alt-svc: + - h3=":443";ma=86400,h3-29=":443";ma=86400,h3-27=":443";ma=86400 + cache-control: + - max-age=300, public, stale-while-revalidate=30, stale-if-error=86400 + content-length: + - '5442' + content-security-policy: + - default-src 'none'; frame-ancestors 'none'; form-action 'none' + content-type: + - application/json; charset=utf-8 + etag: + - W/"bc38a058993fdbe29400795727e9d33c" + referrer-policy: + - same-origin + via: + - 1.1 varnish, 1.1 varnish, 1.1 varnish + x-content-type-options: + - nosniff + x-frame-options: + - DENY + x-ratelimit-limit: + - '300' + x-ratelimit-remaining: + - '270' + x-ratelimit-reset: + - '2025-02-14T22:40:00.053698Z' + x-request-id: + - 8280556bb02fca4d6ed4a6da22529247 + x-runtime: + - '0.032541' + x-xss-protection: + - '0' + status: + code: 200 + message: OK - request: body: null headers: @@ -56,8 +193,8 @@ interactions: "avatar_static": "https://files.mastodon.social/accounts/avatars/000/013/179/original/b4ceb19c9c54ec7e.png", "header": "https://files.mastodon.social/accounts/headers/000/013/179/original/1375be116fbe0f1d.png", "header_static": "https://files.mastodon.social/accounts/headers/000/013/179/original/1375be116fbe0f1d.png", - "followers_count": 837809, "following_count": 4, "statuses_count": 288, "last_status_at": - "2025-01-27", "hide_collections": false, "noindex": false, "emojis": [], "roles": + "followers_count": 837872, "following_count": 4, "statuses_count": 289, "last_status_at": + "2025-02-14", "hide_collections": false, "noindex": false, "emojis": [], "roles": [], "fields": [{"name": "Homepage", "value": "https://joinmastodon.org", @@ -103,7 +240,7 @@ interactions: Connection: - keep-alive Date: - - Fri, 14 Feb 2025 15:38:21 GMT + - Fri, 14 Feb 2025 22:39:47 GMT Strict-Transport-Security: - max-age=31557600 Vary: @@ -113,9 +250,9 @@ interactions: X-Cache-Hits: - 0, 0, 2 X-Served-By: - - cache-fra-etou8220030-FRA, cache-fra-etou8220030-FRA, cache-hel1410027-HEL + - cache-fra-etou8220040-FRA, cache-fra-etou8220030-FRA, cache-hel1410025-HEL X-Timer: - - S1739547502.976318,VS0,VE0 + - S1739572788.804491,VS0,VE0 alt-svc: - h3=":443";ma=86400,h3-29=":443";ma=86400,h3-27=":443";ma=86400 cache-control: @@ -127,7 +264,7 @@ interactions: content-type: - application/json; charset=utf-8 etag: - - W/"551fae2c400427901fea0abc350f319e" + - W/"baea7f6f665258ec0ad4fd954447a184" referrer-policy: - same-origin via: @@ -139,13 +276,13 @@ interactions: x-ratelimit-limit: - '300' x-ratelimit-remaining: - - '283' + - '298' x-ratelimit-reset: - - '2025-02-14T15:40:00.797193Z' + - '2025-02-14T22:40:00.379655Z' x-request-id: - - d0c06378678677c73ba1d406ec7a294b + - e488feea20c504741068107e2a536dd1 x-runtime: - - '0.024948' + - '0.032660' x-xss-protection: - '0' status: diff --git a/tests/cassettes_entity_tests/test_entity_instanceconfiguration.yaml b/tests/cassettes_entity_tests/test_entity_instanceconfiguration.yaml index 2cae635..7e21ab2 100644 --- a/tests/cassettes_entity_tests/test_entity_instanceconfiguration.yaml +++ b/tests/cassettes_entity_tests/test_entity_instanceconfiguration.yaml @@ -20,7 +20,7 @@ interactions: "The original server operated by the Mastodon gGmbH non-profit", "description": "", "email": "staff@mastodon.social", "version": "4.4.0-nightly.2025-02-07", "urls": {"streaming_api": "wss://streaming.mastodon.social"}, "stats": {"user_count": - 2521623, "status_count": 120126443, "domain_count": 81755}, "thumbnail": "https://files.mastodon.social/site_uploads/files/000/000/001/@1x/57c12f441d083cde.png", + 2522485, "status_count": 120163210, "domain_count": 81770}, "thumbnail": "https://files.mastodon.social/site_uploads/files/000/000/001/@1x/57c12f441d083cde.png", "languages": ["en"], "registrations": true, "approval_required": false, "invites_enabled": true, "configuration": {"accounts": {"max_featured_tags": 10}, "statuses": {"max_characters": 500, "max_media_attachments": 4, "characters_reserved_per_url": @@ -41,8 +41,8 @@ interactions: "avatar_static": "https://files.mastodon.social/accounts/avatars/000/013/179/original/b4ceb19c9c54ec7e.png", "header": "https://files.mastodon.social/accounts/headers/000/013/179/original/1375be116fbe0f1d.png", "header_static": "https://files.mastodon.social/accounts/headers/000/013/179/original/1375be116fbe0f1d.png", - "followers_count": 837809, "following_count": 4, "statuses_count": 288, "last_status_at": - "2025-01-27", "hide_collections": false, "noindex": false, "emojis": [], "roles": + "followers_count": 837871, "following_count": 4, "statuses_count": 289, "last_status_at": + "2025-02-14", "hide_collections": false, "noindex": false, "emojis": [], "roles": [], "fields": [{"name": "Homepage", "value": "https://joinmastodon.org", @@ -84,11 +84,11 @@ interactions: Accept-Ranges: - bytes Age: - - '232' + - '220' Connection: - keep-alive Date: - - Fri, 14 Feb 2025 15:38:20 GMT + - Fri, 14 Feb 2025 22:39:46 GMT Strict-Transport-Security: - max-age=31557600 Vary: @@ -96,11 +96,11 @@ interactions: X-Cache: - MISS, HIT, HIT X-Cache-Hits: - - 0, 5, 1 + - 0, 5, 2 X-Served-By: - - cache-fra-eddf8230164-FRA, cache-fra-eddf8230152-FRA, cache-hel1410023-HEL + - cache-fra-eddf8230164-FRA, cache-fra-eddf8230152-FRA, cache-hel1410030-HEL X-Timer: - - S1739547501.502324,VS0,VE1 + - S1739572786.128363,VS0,VE0 alt-svc: - h3=":443";ma=86400,h3-29=":443";ma=86400,h3-27=":443";ma=86400 cache-control: @@ -112,7 +112,7 @@ interactions: content-type: - application/json; charset=utf-8 etag: - - W/"e83f947e4236ab50c372b04653b2c955" + - W/"bc38a058993fdbe29400795727e9d33c" referrer-policy: - same-origin via: @@ -124,13 +124,13 @@ interactions: x-ratelimit-limit: - '300' x-ratelimit-remaining: - - '173' + - '270' x-ratelimit-reset: - - '2025-02-14T15:35:00.651194Z' + - '2025-02-14T22:40:00.053698Z' x-request-id: - - 65e3ef547e7f34e6712a02c124593883 + - 8280556bb02fca4d6ed4a6da22529247 x-runtime: - - '0.266735' + - '0.032541' x-xss-protection: - '0' status: diff --git a/tests/cassettes_entity_tests/test_entity_instanceconfigurationv2.yaml b/tests/cassettes_entity_tests/test_entity_instanceconfigurationv2.yaml index 75d2b9a..bc46144 100644 --- a/tests/cassettes_entity_tests/test_entity_instanceconfigurationv2.yaml +++ b/tests/cassettes_entity_tests/test_entity_instanceconfigurationv2.yaml @@ -56,8 +56,8 @@ interactions: "avatar_static": "https://files.mastodon.social/accounts/avatars/000/013/179/original/b4ceb19c9c54ec7e.png", "header": "https://files.mastodon.social/accounts/headers/000/013/179/original/1375be116fbe0f1d.png", "header_static": "https://files.mastodon.social/accounts/headers/000/013/179/original/1375be116fbe0f1d.png", - "followers_count": 837809, "following_count": 4, "statuses_count": 288, "last_status_at": - "2025-01-27", "hide_collections": false, "noindex": false, "emojis": [], "roles": + "followers_count": 837872, "following_count": 4, "statuses_count": 289, "last_status_at": + "2025-02-14", "hide_collections": false, "noindex": false, "emojis": [], "roles": [], "fields": [{"name": "Homepage", "value": "https://joinmastodon.org", @@ -103,7 +103,7 @@ interactions: Connection: - keep-alive Date: - - Fri, 14 Feb 2025 15:38:21 GMT + - Fri, 14 Feb 2025 22:39:46 GMT Strict-Transport-Security: - max-age=31557600 Vary: @@ -113,9 +113,9 @@ interactions: X-Cache-Hits: - 0, 0, 1 X-Served-By: - - cache-fra-etou8220030-FRA, cache-fra-etou8220030-FRA, cache-hel1410026-HEL + - cache-fra-etou8220040-FRA, cache-fra-etou8220030-FRA, cache-hel1410030-HEL X-Timer: - - S1739547501.012544,VS0,VE1 + - S1739572787.632292,VS0,VE1 alt-svc: - h3=":443";ma=86400,h3-29=":443";ma=86400,h3-27=":443";ma=86400 cache-control: @@ -127,7 +127,7 @@ interactions: content-type: - application/json; charset=utf-8 etag: - - W/"551fae2c400427901fea0abc350f319e" + - W/"baea7f6f665258ec0ad4fd954447a184" referrer-policy: - same-origin via: @@ -139,13 +139,13 @@ interactions: x-ratelimit-limit: - '300' x-ratelimit-remaining: - - '283' + - '298' x-ratelimit-reset: - - '2025-02-14T15:40:00.797193Z' + - '2025-02-14T22:40:00.379655Z' x-request-id: - - d0c06378678677c73ba1d406ec7a294b + - e488feea20c504741068107e2a536dd1 x-runtime: - - '0.024948' + - '0.032660' x-xss-protection: - '0' status: diff --git a/tests/cassettes_entity_tests/test_entity_instancecontact.yaml b/tests/cassettes_entity_tests/test_entity_instancecontact.yaml index ad5e9e3..7a71f59 100644 --- a/tests/cassettes_entity_tests/test_entity_instancecontact.yaml +++ b/tests/cassettes_entity_tests/test_entity_instancecontact.yaml @@ -1,4 +1,141 @@ interactions: +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Authorization: + - DUMMY + Connection: + - keep-alive + User-Agent: + - mastodonpy + method: GET + uri: https://mastodon.social/api/v1/instance/ + response: + body: + string: '{"uri": "mastodon.social", "title": "Mastodon", "short_description": + "The original server operated by the Mastodon gGmbH non-profit", "description": + "", "email": "staff@mastodon.social", "version": "4.4.0-nightly.2025-02-07", + "urls": {"streaming_api": "wss://streaming.mastodon.social"}, "stats": {"user_count": + 2522485, "status_count": 120163210, "domain_count": 81770}, "thumbnail": "https://files.mastodon.social/site_uploads/files/000/000/001/@1x/57c12f441d083cde.png", + "languages": ["en"], "registrations": true, "approval_required": false, "invites_enabled": + true, "configuration": {"accounts": {"max_featured_tags": 10}, "statuses": + {"max_characters": 500, "max_media_attachments": 4, "characters_reserved_per_url": + 23}, "media_attachments": {"supported_mime_types": ["image/jpeg", "image/png", + "image/gif", "image/heic", "image/heif", "image/webp", "image/avif", "video/webm", + "video/mp4", "video/quicktime", "video/ogg", "audio/wave", "audio/wav", "audio/x-wav", + "audio/x-pn-wave", "audio/vnd.wave", "audio/ogg", "audio/vorbis", "audio/mpeg", + "audio/mp3", "audio/webm", "audio/flac", "audio/aac", "audio/m4a", "audio/x-m4a", + "audio/mp4", "audio/3gpp", "video/x-ms-asf"], "image_size_limit": 16777216, + "image_matrix_limit": 33177600, "video_size_limit": 103809024, "video_frame_rate_limit": + 120, "video_matrix_limit": 8294400}, "polls": {"max_options": 4, "max_characters_per_option": + 50, "min_expiration": 300, "max_expiration": 2629746}}, "contact_account": + {"id": "13179", "username": "Mastodon", "acct": "Mastodon", "display_name": + "Mastodon", "locked": false, "bot": false, "discoverable": true, "indexable": + false, "group": false, "created_at": "2016-11-23T00:00:00.000Z", "note": "

Free, + open-source decentralized social media platform.

", "url": "https://mastodon.social/@Mastodon", + "uri": "https://mastodon.social/users/Mastodon", "avatar": "https://files.mastodon.social/accounts/avatars/000/013/179/original/b4ceb19c9c54ec7e.png", + "avatar_static": "https://files.mastodon.social/accounts/avatars/000/013/179/original/b4ceb19c9c54ec7e.png", + "header": "https://files.mastodon.social/accounts/headers/000/013/179/original/1375be116fbe0f1d.png", + "header_static": "https://files.mastodon.social/accounts/headers/000/013/179/original/1375be116fbe0f1d.png", + "followers_count": 837871, "following_count": 4, "statuses_count": 289, "last_status_at": + "2025-02-14", "hide_collections": false, "noindex": false, "emojis": [], "roles": + [], "fields": [{"name": "Homepage", "value": "https://joinmastodon.org", + "verified_at": "2018-10-31T04:11:00.076+00:00"}, {"name": "Patreon", "value": + "https://patreon.com/mastodon", + "verified_at": null}, {"name": "GitHub", "value": "https://github.com/mastodon", + "verified_at": "2023-07-21T13:27:45.996+00:00"}]}, "rules": [{"id": "1", "text": + "Sexually explicit or violent media must be marked as sensitive or with a + content warning", "hint": "This includes content that is particularly provocative + even if it may not show specific body parts, as well as dead bodies, bloody + injuries, and other gore. Particularly obscene content may be prohibited entirely. + Profile pictures and header images may not contain sexually explicit or violent + media."}, {"id": "2", "text": "No racism, sexism, homophobia, transphobia, + ableism, xenophobia, or casteism.", "hint": "Transphobic behavior such as + intentional misgendering and deadnaming is strictly prohibited. Promotion + of \"conversion therapy\" is strictly prohibited. Criticism of governments + and religions is permissible unless being used as a proxy for discrimination."}, + {"id": "3", "text": "No incitement of violence or promotion of violent ideologies", + "hint": "Calling for people or groups to be assassinated, murdered, or attacked + physically is strictly prohibited. Support for violent groups or events is + prohibited."}, {"id": "4", "text": "No harassment, block evasion, dogpiling, + or doxxing of others", "hint": "Repeat attempts to communicate with users + who have blocked you or creation of accounts solely to harass or insult individuals + is strictly prohibited. Coordinated activity to attack other users is prohibited. + Posting of private personal information about others is prohibited."}, {"id": + "7", "text": "Do not share information widely-known to be false and misleading", + "hint": "False and misleading information and links from low-quality sources + may not be posted, especially if they are likely to mislead or confuse others + or endanger their safety."}, {"id": "1008", "text": "Content created by others + must be attributed, and use of generative AI must be disclosed", "hint": "Content + created by others must clearly provide a reference to the author, creator, + or source. For adult content, this should include performers. Accounts may + not solely post AI-generated content."}]}' + headers: + Accept-Ranges: + - bytes + Age: + - '221' + Connection: + - keep-alive + Date: + - Fri, 14 Feb 2025 22:39:47 GMT + Strict-Transport-Security: + - max-age=31557600 + Vary: + - Accept, Origin, Accept-Encoding + X-Cache: + - MISS, HIT, HIT + X-Cache-Hits: + - 0, 5, 1 + X-Served-By: + - cache-fra-eddf8230164-FRA, cache-fra-eddf8230152-FRA, cache-hel1410025-HEL + X-Timer: + - S1739572788.598295,VS0,VE1 + alt-svc: + - h3=":443";ma=86400,h3-29=":443";ma=86400,h3-27=":443";ma=86400 + cache-control: + - max-age=300, public, stale-while-revalidate=30, stale-if-error=86400 + content-length: + - '5442' + content-security-policy: + - default-src 'none'; frame-ancestors 'none'; form-action 'none' + content-type: + - application/json; charset=utf-8 + etag: + - W/"bc38a058993fdbe29400795727e9d33c" + referrer-policy: + - same-origin + via: + - 1.1 varnish, 1.1 varnish, 1.1 varnish + x-content-type-options: + - nosniff + x-frame-options: + - DENY + x-ratelimit-limit: + - '300' + x-ratelimit-remaining: + - '270' + x-ratelimit-reset: + - '2025-02-14T22:40:00.053698Z' + x-request-id: + - 8280556bb02fca4d6ed4a6da22529247 + x-runtime: + - '0.032541' + x-xss-protection: + - '0' + status: + code: 200 + message: OK - request: body: null headers: @@ -56,8 +193,8 @@ interactions: "avatar_static": "https://files.mastodon.social/accounts/avatars/000/013/179/original/b4ceb19c9c54ec7e.png", "header": "https://files.mastodon.social/accounts/headers/000/013/179/original/1375be116fbe0f1d.png", "header_static": "https://files.mastodon.social/accounts/headers/000/013/179/original/1375be116fbe0f1d.png", - "followers_count": 837809, "following_count": 4, "statuses_count": 288, "last_status_at": - "2025-01-27", "hide_collections": false, "noindex": false, "emojis": [], "roles": + "followers_count": 837872, "following_count": 4, "statuses_count": 289, "last_status_at": + "2025-02-14", "hide_collections": false, "noindex": false, "emojis": [], "roles": [], "fields": [{"name": "Homepage", "value": "https://joinmastodon.org", @@ -103,7 +240,7 @@ interactions: Connection: - keep-alive Date: - - Fri, 14 Feb 2025 15:38:21 GMT + - Fri, 14 Feb 2025 22:39:47 GMT Strict-Transport-Security: - max-age=31557600 Vary: @@ -111,11 +248,11 @@ interactions: X-Cache: - MISS, MISS, HIT X-Cache-Hits: - - 0, 0, 2 + - 0, 0, 1 X-Served-By: - - cache-fra-etou8220030-FRA, cache-fra-etou8220030-FRA, cache-hel1410026-HEL + - cache-fra-etou8220040-FRA, cache-fra-etou8220030-FRA, cache-hel1410025-HEL X-Timer: - - S1739547502.868892,VS0,VE0 + - S1739572788.635140,VS0,VE1 alt-svc: - h3=":443";ma=86400,h3-29=":443";ma=86400,h3-27=":443";ma=86400 cache-control: @@ -127,7 +264,7 @@ interactions: content-type: - application/json; charset=utf-8 etag: - - W/"551fae2c400427901fea0abc350f319e" + - W/"baea7f6f665258ec0ad4fd954447a184" referrer-policy: - same-origin via: @@ -139,13 +276,13 @@ interactions: x-ratelimit-limit: - '300' x-ratelimit-remaining: - - '283' + - '298' x-ratelimit-reset: - - '2025-02-14T15:40:00.797193Z' + - '2025-02-14T22:40:00.379655Z' x-request-id: - - d0c06378678677c73ba1d406ec7a294b + - e488feea20c504741068107e2a536dd1 x-runtime: - - '0.024948' + - '0.032660' x-xss-protection: - '0' status: diff --git a/tests/cassettes_entity_tests/test_entity_instanceicon.yaml b/tests/cassettes_entity_tests/test_entity_instanceicon.yaml index e475a59..9eea54d 100644 --- a/tests/cassettes_entity_tests/test_entity_instanceicon.yaml +++ b/tests/cassettes_entity_tests/test_entity_instanceicon.yaml @@ -56,8 +56,8 @@ interactions: "avatar_static": "https://files.mastodon.social/accounts/avatars/000/013/179/original/b4ceb19c9c54ec7e.png", "header": "https://files.mastodon.social/accounts/headers/000/013/179/original/1375be116fbe0f1d.png", "header_static": "https://files.mastodon.social/accounts/headers/000/013/179/original/1375be116fbe0f1d.png", - "followers_count": 837809, "following_count": 4, "statuses_count": 288, "last_status_at": - "2025-01-27", "hide_collections": false, "noindex": false, "emojis": [], "roles": + "followers_count": 837872, "following_count": 4, "statuses_count": 289, "last_status_at": + "2025-02-14", "hide_collections": false, "noindex": false, "emojis": [], "roles": [], "fields": [{"name": "Homepage", "value": "https://joinmastodon.org", @@ -103,7 +103,7 @@ interactions: Connection: - keep-alive Date: - - Fri, 14 Feb 2025 15:38:20 GMT + - Fri, 14 Feb 2025 22:39:46 GMT Strict-Transport-Security: - max-age=31557600 Vary: @@ -113,9 +113,9 @@ interactions: X-Cache-Hits: - 0, 0, 1 X-Served-By: - - cache-fra-etou8220030-FRA, cache-fra-etou8220030-FRA, cache-hel1410023-HEL + - cache-fra-etou8220040-FRA, cache-fra-etou8220030-FRA, cache-hel1410022-HEL X-Timer: - - S1739547501.927990,VS0,VE2 + - S1739572787.552375,VS0,VE1 alt-svc: - h3=":443";ma=86400,h3-29=":443";ma=86400,h3-27=":443";ma=86400 cache-control: @@ -127,7 +127,7 @@ interactions: content-type: - application/json; charset=utf-8 etag: - - W/"551fae2c400427901fea0abc350f319e" + - W/"baea7f6f665258ec0ad4fd954447a184" referrer-policy: - same-origin via: @@ -139,13 +139,13 @@ interactions: x-ratelimit-limit: - '300' x-ratelimit-remaining: - - '283' + - '298' x-ratelimit-reset: - - '2025-02-14T15:40:00.797193Z' + - '2025-02-14T22:40:00.379655Z' x-request-id: - - d0c06378678677c73ba1d406ec7a294b + - e488feea20c504741068107e2a536dd1 x-runtime: - - '0.024948' + - '0.032660' x-xss-protection: - '0' status: diff --git a/tests/cassettes_entity_tests/test_entity_instancemediaconfiguration.yaml b/tests/cassettes_entity_tests/test_entity_instancemediaconfiguration.yaml index 122c5fb..43ffacd 100644 --- a/tests/cassettes_entity_tests/test_entity_instancemediaconfiguration.yaml +++ b/tests/cassettes_entity_tests/test_entity_instancemediaconfiguration.yaml @@ -1,4 +1,141 @@ interactions: +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Authorization: + - DUMMY + Connection: + - keep-alive + User-Agent: + - mastodonpy + method: GET + uri: https://mastodon.social/api/v1/instance/ + response: + body: + string: '{"uri": "mastodon.social", "title": "Mastodon", "short_description": + "The original server operated by the Mastodon gGmbH non-profit", "description": + "", "email": "staff@mastodon.social", "version": "4.4.0-nightly.2025-02-07", + "urls": {"streaming_api": "wss://streaming.mastodon.social"}, "stats": {"user_count": + 2522485, "status_count": 120163210, "domain_count": 81770}, "thumbnail": "https://files.mastodon.social/site_uploads/files/000/000/001/@1x/57c12f441d083cde.png", + "languages": ["en"], "registrations": true, "approval_required": false, "invites_enabled": + true, "configuration": {"accounts": {"max_featured_tags": 10}, "statuses": + {"max_characters": 500, "max_media_attachments": 4, "characters_reserved_per_url": + 23}, "media_attachments": {"supported_mime_types": ["image/jpeg", "image/png", + "image/gif", "image/heic", "image/heif", "image/webp", "image/avif", "video/webm", + "video/mp4", "video/quicktime", "video/ogg", "audio/wave", "audio/wav", "audio/x-wav", + "audio/x-pn-wave", "audio/vnd.wave", "audio/ogg", "audio/vorbis", "audio/mpeg", + "audio/mp3", "audio/webm", "audio/flac", "audio/aac", "audio/m4a", "audio/x-m4a", + "audio/mp4", "audio/3gpp", "video/x-ms-asf"], "image_size_limit": 16777216, + "image_matrix_limit": 33177600, "video_size_limit": 103809024, "video_frame_rate_limit": + 120, "video_matrix_limit": 8294400}, "polls": {"max_options": 4, "max_characters_per_option": + 50, "min_expiration": 300, "max_expiration": 2629746}}, "contact_account": + {"id": "13179", "username": "Mastodon", "acct": "Mastodon", "display_name": + "Mastodon", "locked": false, "bot": false, "discoverable": true, "indexable": + false, "group": false, "created_at": "2016-11-23T00:00:00.000Z", "note": "

Free, + open-source decentralized social media platform.

", "url": "https://mastodon.social/@Mastodon", + "uri": "https://mastodon.social/users/Mastodon", "avatar": "https://files.mastodon.social/accounts/avatars/000/013/179/original/b4ceb19c9c54ec7e.png", + "avatar_static": "https://files.mastodon.social/accounts/avatars/000/013/179/original/b4ceb19c9c54ec7e.png", + "header": "https://files.mastodon.social/accounts/headers/000/013/179/original/1375be116fbe0f1d.png", + "header_static": "https://files.mastodon.social/accounts/headers/000/013/179/original/1375be116fbe0f1d.png", + "followers_count": 837871, "following_count": 4, "statuses_count": 289, "last_status_at": + "2025-02-14", "hide_collections": false, "noindex": false, "emojis": [], "roles": + [], "fields": [{"name": "Homepage", "value": "https://joinmastodon.org", + "verified_at": "2018-10-31T04:11:00.076+00:00"}, {"name": "Patreon", "value": + "https://patreon.com/mastodon", + "verified_at": null}, {"name": "GitHub", "value": "https://github.com/mastodon", + "verified_at": "2023-07-21T13:27:45.996+00:00"}]}, "rules": [{"id": "1", "text": + "Sexually explicit or violent media must be marked as sensitive or with a + content warning", "hint": "This includes content that is particularly provocative + even if it may not show specific body parts, as well as dead bodies, bloody + injuries, and other gore. Particularly obscene content may be prohibited entirely. + Profile pictures and header images may not contain sexually explicit or violent + media."}, {"id": "2", "text": "No racism, sexism, homophobia, transphobia, + ableism, xenophobia, or casteism.", "hint": "Transphobic behavior such as + intentional misgendering and deadnaming is strictly prohibited. Promotion + of \"conversion therapy\" is strictly prohibited. Criticism of governments + and religions is permissible unless being used as a proxy for discrimination."}, + {"id": "3", "text": "No incitement of violence or promotion of violent ideologies", + "hint": "Calling for people or groups to be assassinated, murdered, or attacked + physically is strictly prohibited. Support for violent groups or events is + prohibited."}, {"id": "4", "text": "No harassment, block evasion, dogpiling, + or doxxing of others", "hint": "Repeat attempts to communicate with users + who have blocked you or creation of accounts solely to harass or insult individuals + is strictly prohibited. Coordinated activity to attack other users is prohibited. + Posting of private personal information about others is prohibited."}, {"id": + "7", "text": "Do not share information widely-known to be false and misleading", + "hint": "False and misleading information and links from low-quality sources + may not be posted, especially if they are likely to mislead or confuse others + or endanger their safety."}, {"id": "1008", "text": "Content created by others + must be attributed, and use of generative AI must be disclosed", "hint": "Content + created by others must clearly provide a reference to the author, creator, + or source. For adult content, this should include performers. Accounts may + not solely post AI-generated content."}]}' + headers: + Accept-Ranges: + - bytes + Age: + - '222' + Connection: + - keep-alive + Date: + - Fri, 14 Feb 2025 22:39:48 GMT + Strict-Transport-Security: + - max-age=31557600 + Vary: + - Accept, Origin, Accept-Encoding + X-Cache: + - MISS, HIT, HIT + X-Cache-Hits: + - 0, 5, 4 + X-Served-By: + - cache-fra-eddf8230164-FRA, cache-fra-eddf8230152-FRA, cache-hel1410030-HEL + X-Timer: + - S1739572788.125459,VS0,VE0 + alt-svc: + - h3=":443";ma=86400,h3-29=":443";ma=86400,h3-27=":443";ma=86400 + cache-control: + - max-age=300, public, stale-while-revalidate=30, stale-if-error=86400 + content-length: + - '5442' + content-security-policy: + - default-src 'none'; frame-ancestors 'none'; form-action 'none' + content-type: + - application/json; charset=utf-8 + etag: + - W/"bc38a058993fdbe29400795727e9d33c" + referrer-policy: + - same-origin + via: + - 1.1 varnish, 1.1 varnish, 1.1 varnish + x-content-type-options: + - nosniff + x-frame-options: + - DENY + x-ratelimit-limit: + - '300' + x-ratelimit-remaining: + - '270' + x-ratelimit-reset: + - '2025-02-14T22:40:00.053698Z' + x-request-id: + - 8280556bb02fca4d6ed4a6da22529247 + x-runtime: + - '0.032541' + x-xss-protection: + - '0' + status: + code: 200 + message: OK - request: body: null headers: @@ -56,8 +193,8 @@ interactions: "avatar_static": "https://files.mastodon.social/accounts/avatars/000/013/179/original/b4ceb19c9c54ec7e.png", "header": "https://files.mastodon.social/accounts/headers/000/013/179/original/1375be116fbe0f1d.png", "header_static": "https://files.mastodon.social/accounts/headers/000/013/179/original/1375be116fbe0f1d.png", - "followers_count": 837809, "following_count": 4, "statuses_count": 288, "last_status_at": - "2025-01-27", "hide_collections": false, "noindex": false, "emojis": [], "roles": + "followers_count": 837872, "following_count": 4, "statuses_count": 289, "last_status_at": + "2025-02-14", "hide_collections": false, "noindex": false, "emojis": [], "roles": [], "fields": [{"name": "Homepage", "value": "https://joinmastodon.org", @@ -99,11 +236,11 @@ interactions: Accept-Ranges: - bytes Age: - - '1' + - '2' Connection: - keep-alive Date: - - Fri, 14 Feb 2025 15:38:22 GMT + - Fri, 14 Feb 2025 22:39:48 GMT Strict-Transport-Security: - max-age=31557600 Vary: @@ -113,9 +250,9 @@ interactions: X-Cache-Hits: - 0, 0, 3 X-Served-By: - - cache-fra-etou8220030-FRA, cache-fra-etou8220030-FRA, cache-hel1410026-HEL + - cache-fra-etou8220040-FRA, cache-fra-etou8220030-FRA, cache-hel1410030-HEL X-Timer: - - S1739547502.183156,VS0,VE0 + - S1739572788.160277,VS0,VE0 alt-svc: - h3=":443";ma=86400,h3-29=":443";ma=86400,h3-27=":443";ma=86400 cache-control: @@ -127,7 +264,7 @@ interactions: content-type: - application/json; charset=utf-8 etag: - - W/"551fae2c400427901fea0abc350f319e" + - W/"baea7f6f665258ec0ad4fd954447a184" referrer-policy: - same-origin via: @@ -139,13 +276,13 @@ interactions: x-ratelimit-limit: - '300' x-ratelimit-remaining: - - '283' + - '298' x-ratelimit-reset: - - '2025-02-14T15:40:00.797193Z' + - '2025-02-14T22:40:00.379655Z' x-request-id: - - d0c06378678677c73ba1d406ec7a294b + - e488feea20c504741068107e2a536dd1 x-runtime: - - '0.024948' + - '0.032660' x-xss-protection: - '0' status: diff --git a/tests/cassettes_entity_tests/test_entity_instancepollconfiguration.yaml b/tests/cassettes_entity_tests/test_entity_instancepollconfiguration.yaml index a97c382..e765b31 100644 --- a/tests/cassettes_entity_tests/test_entity_instancepollconfiguration.yaml +++ b/tests/cassettes_entity_tests/test_entity_instancepollconfiguration.yaml @@ -1,4 +1,141 @@ interactions: +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Authorization: + - DUMMY + Connection: + - keep-alive + User-Agent: + - mastodonpy + method: GET + uri: https://mastodon.social/api/v1/instance/ + response: + body: + string: '{"uri": "mastodon.social", "title": "Mastodon", "short_description": + "The original server operated by the Mastodon gGmbH non-profit", "description": + "", "email": "staff@mastodon.social", "version": "4.4.0-nightly.2025-02-07", + "urls": {"streaming_api": "wss://streaming.mastodon.social"}, "stats": {"user_count": + 2522485, "status_count": 120163210, "domain_count": 81770}, "thumbnail": "https://files.mastodon.social/site_uploads/files/000/000/001/@1x/57c12f441d083cde.png", + "languages": ["en"], "registrations": true, "approval_required": false, "invites_enabled": + true, "configuration": {"accounts": {"max_featured_tags": 10}, "statuses": + {"max_characters": 500, "max_media_attachments": 4, "characters_reserved_per_url": + 23}, "media_attachments": {"supported_mime_types": ["image/jpeg", "image/png", + "image/gif", "image/heic", "image/heif", "image/webp", "image/avif", "video/webm", + "video/mp4", "video/quicktime", "video/ogg", "audio/wave", "audio/wav", "audio/x-wav", + "audio/x-pn-wave", "audio/vnd.wave", "audio/ogg", "audio/vorbis", "audio/mpeg", + "audio/mp3", "audio/webm", "audio/flac", "audio/aac", "audio/m4a", "audio/x-m4a", + "audio/mp4", "audio/3gpp", "video/x-ms-asf"], "image_size_limit": 16777216, + "image_matrix_limit": 33177600, "video_size_limit": 103809024, "video_frame_rate_limit": + 120, "video_matrix_limit": 8294400}, "polls": {"max_options": 4, "max_characters_per_option": + 50, "min_expiration": 300, "max_expiration": 2629746}}, "contact_account": + {"id": "13179", "username": "Mastodon", "acct": "Mastodon", "display_name": + "Mastodon", "locked": false, "bot": false, "discoverable": true, "indexable": + false, "group": false, "created_at": "2016-11-23T00:00:00.000Z", "note": "

Free, + open-source decentralized social media platform.

", "url": "https://mastodon.social/@Mastodon", + "uri": "https://mastodon.social/users/Mastodon", "avatar": "https://files.mastodon.social/accounts/avatars/000/013/179/original/b4ceb19c9c54ec7e.png", + "avatar_static": "https://files.mastodon.social/accounts/avatars/000/013/179/original/b4ceb19c9c54ec7e.png", + "header": "https://files.mastodon.social/accounts/headers/000/013/179/original/1375be116fbe0f1d.png", + "header_static": "https://files.mastodon.social/accounts/headers/000/013/179/original/1375be116fbe0f1d.png", + "followers_count": 837871, "following_count": 4, "statuses_count": 289, "last_status_at": + "2025-02-14", "hide_collections": false, "noindex": false, "emojis": [], "roles": + [], "fields": [{"name": "Homepage", "value": "https://joinmastodon.org", + "verified_at": "2018-10-31T04:11:00.076+00:00"}, {"name": "Patreon", "value": + "https://patreon.com/mastodon", + "verified_at": null}, {"name": "GitHub", "value": "https://github.com/mastodon", + "verified_at": "2023-07-21T13:27:45.996+00:00"}]}, "rules": [{"id": "1", "text": + "Sexually explicit or violent media must be marked as sensitive or with a + content warning", "hint": "This includes content that is particularly provocative + even if it may not show specific body parts, as well as dead bodies, bloody + injuries, and other gore. Particularly obscene content may be prohibited entirely. + Profile pictures and header images may not contain sexually explicit or violent + media."}, {"id": "2", "text": "No racism, sexism, homophobia, transphobia, + ableism, xenophobia, or casteism.", "hint": "Transphobic behavior such as + intentional misgendering and deadnaming is strictly prohibited. Promotion + of \"conversion therapy\" is strictly prohibited. Criticism of governments + and religions is permissible unless being used as a proxy for discrimination."}, + {"id": "3", "text": "No incitement of violence or promotion of violent ideologies", + "hint": "Calling for people or groups to be assassinated, murdered, or attacked + physically is strictly prohibited. Support for violent groups or events is + prohibited."}, {"id": "4", "text": "No harassment, block evasion, dogpiling, + or doxxing of others", "hint": "Repeat attempts to communicate with users + who have blocked you or creation of accounts solely to harass or insult individuals + is strictly prohibited. Coordinated activity to attack other users is prohibited. + Posting of private personal information about others is prohibited."}, {"id": + "7", "text": "Do not share information widely-known to be false and misleading", + "hint": "False and misleading information and links from low-quality sources + may not be posted, especially if they are likely to mislead or confuse others + or endanger their safety."}, {"id": "1008", "text": "Content created by others + must be attributed, and use of generative AI must be disclosed", "hint": "Content + created by others must clearly provide a reference to the author, creator, + or source. For adult content, this should include performers. Accounts may + not solely post AI-generated content."}]}' + headers: + Accept-Ranges: + - bytes + Age: + - '222' + Connection: + - keep-alive + Date: + - Fri, 14 Feb 2025 22:39:48 GMT + Strict-Transport-Security: + - max-age=31557600 + Vary: + - Accept, Origin, Accept-Encoding + X-Cache: + - MISS, HIT, HIT + X-Cache-Hits: + - 0, 5, 5 + X-Served-By: + - cache-fra-eddf8230164-FRA, cache-fra-eddf8230152-FRA, cache-hel1410030-HEL + X-Timer: + - S1739572788.246194,VS0,VE0 + alt-svc: + - h3=":443";ma=86400,h3-29=":443";ma=86400,h3-27=":443";ma=86400 + cache-control: + - max-age=300, public, stale-while-revalidate=30, stale-if-error=86400 + content-length: + - '5442' + content-security-policy: + - default-src 'none'; frame-ancestors 'none'; form-action 'none' + content-type: + - application/json; charset=utf-8 + etag: + - W/"bc38a058993fdbe29400795727e9d33c" + referrer-policy: + - same-origin + via: + - 1.1 varnish, 1.1 varnish, 1.1 varnish + x-content-type-options: + - nosniff + x-frame-options: + - DENY + x-ratelimit-limit: + - '300' + x-ratelimit-remaining: + - '270' + x-ratelimit-reset: + - '2025-02-14T22:40:00.053698Z' + x-request-id: + - 8280556bb02fca4d6ed4a6da22529247 + x-runtime: + - '0.032541' + x-xss-protection: + - '0' + status: + code: 200 + message: OK - request: body: null headers: @@ -56,8 +193,8 @@ interactions: "avatar_static": "https://files.mastodon.social/accounts/avatars/000/013/179/original/b4ceb19c9c54ec7e.png", "header": "https://files.mastodon.social/accounts/headers/000/013/179/original/1375be116fbe0f1d.png", "header_static": "https://files.mastodon.social/accounts/headers/000/013/179/original/1375be116fbe0f1d.png", - "followers_count": 837809, "following_count": 4, "statuses_count": 288, "last_status_at": - "2025-01-27", "hide_collections": false, "noindex": false, "emojis": [], "roles": + "followers_count": 837872, "following_count": 4, "statuses_count": 289, "last_status_at": + "2025-02-14", "hide_collections": false, "noindex": false, "emojis": [], "roles": [], "fields": [{"name": "Homepage", "value": "https://joinmastodon.org", @@ -103,7 +240,7 @@ interactions: Connection: - keep-alive Date: - - Fri, 14 Feb 2025 15:38:22 GMT + - Fri, 14 Feb 2025 22:39:48 GMT Strict-Transport-Security: - max-age=31557600 Vary: @@ -111,11 +248,11 @@ interactions: X-Cache: - MISS, MISS, HIT X-Cache-Hits: - - 0, 0, 3 + - 0, 0, 4 X-Served-By: - - cache-fra-etou8220030-FRA, cache-fra-etou8220030-FRA, cache-hel1410030-HEL + - cache-fra-etou8220040-FRA, cache-fra-etou8220030-FRA, cache-hel1410030-HEL X-Timer: - - S1739547502.256672,VS0,VE0 + - S1739572788.292554,VS0,VE0 alt-svc: - h3=":443";ma=86400,h3-29=":443";ma=86400,h3-27=":443";ma=86400 cache-control: @@ -127,7 +264,7 @@ interactions: content-type: - application/json; charset=utf-8 etag: - - W/"551fae2c400427901fea0abc350f319e" + - W/"baea7f6f665258ec0ad4fd954447a184" referrer-policy: - same-origin via: @@ -139,13 +276,13 @@ interactions: x-ratelimit-limit: - '300' x-ratelimit-remaining: - - '283' + - '298' x-ratelimit-reset: - - '2025-02-14T15:40:00.797193Z' + - '2025-02-14T22:40:00.379655Z' x-request-id: - - d0c06378678677c73ba1d406ec7a294b + - e488feea20c504741068107e2a536dd1 x-runtime: - - '0.024948' + - '0.032660' x-xss-protection: - '0' status: diff --git a/tests/cassettes_entity_tests/test_entity_instanceregistrations.yaml b/tests/cassettes_entity_tests/test_entity_instanceregistrations.yaml index 30ecda3..3068d1c 100644 --- a/tests/cassettes_entity_tests/test_entity_instanceregistrations.yaml +++ b/tests/cassettes_entity_tests/test_entity_instanceregistrations.yaml @@ -56,8 +56,8 @@ interactions: "avatar_static": "https://files.mastodon.social/accounts/avatars/000/013/179/original/b4ceb19c9c54ec7e.png", "header": "https://files.mastodon.social/accounts/headers/000/013/179/original/1375be116fbe0f1d.png", "header_static": "https://files.mastodon.social/accounts/headers/000/013/179/original/1375be116fbe0f1d.png", - "followers_count": 837809, "following_count": 4, "statuses_count": 288, "last_status_at": - "2025-01-27", "hide_collections": false, "noindex": false, "emojis": [], "roles": + "followers_count": 837872, "following_count": 4, "statuses_count": 289, "last_status_at": + "2025-02-14", "hide_collections": false, "noindex": false, "emojis": [], "roles": [], "fields": [{"name": "Homepage", "value": "https://joinmastodon.org", @@ -103,7 +103,7 @@ interactions: Connection: - keep-alive Date: - - Fri, 14 Feb 2025 15:38:21 GMT + - Fri, 14 Feb 2025 22:39:47 GMT Strict-Transport-Security: - max-age=31557600 Vary: @@ -111,11 +111,11 @@ interactions: X-Cache: - MISS, MISS, HIT X-Cache-Hits: - - 0, 0, 2 + - 0, 0, 7 X-Served-By: - - cache-fra-etou8220030-FRA, cache-fra-etou8220030-FRA, cache-hel1410030-HEL + - cache-fra-etou8220040-FRA, cache-fra-etou8220030-FRA, cache-hel1410021-HEL X-Timer: - - S1739547502.792309,VS0,VE0 + - S1739572788.521656,VS0,VE0 alt-svc: - h3=":443";ma=86400,h3-29=":443";ma=86400,h3-27=":443";ma=86400 cache-control: @@ -127,7 +127,7 @@ interactions: content-type: - application/json; charset=utf-8 etag: - - W/"551fae2c400427901fea0abc350f319e" + - W/"baea7f6f665258ec0ad4fd954447a184" referrer-policy: - same-origin via: @@ -139,13 +139,13 @@ interactions: x-ratelimit-limit: - '300' x-ratelimit-remaining: - - '283' + - '298' x-ratelimit-reset: - - '2025-02-14T15:40:00.797193Z' + - '2025-02-14T22:40:00.379655Z' x-request-id: - - d0c06378678677c73ba1d406ec7a294b + - e488feea20c504741068107e2a536dd1 x-runtime: - - '0.024948' + - '0.032660' x-xss-protection: - '0' status: diff --git a/tests/cassettes_entity_tests/test_entity_instancestatistics.yaml b/tests/cassettes_entity_tests/test_entity_instancestatistics.yaml index 7fb1691..de4ad48 100644 --- a/tests/cassettes_entity_tests/test_entity_instancestatistics.yaml +++ b/tests/cassettes_entity_tests/test_entity_instancestatistics.yaml @@ -20,7 +20,7 @@ interactions: "The original server operated by the Mastodon gGmbH non-profit", "description": "", "email": "staff@mastodon.social", "version": "4.4.0-nightly.2025-02-07", "urls": {"streaming_api": "wss://streaming.mastodon.social"}, "stats": {"user_count": - 2521623, "status_count": 120126443, "domain_count": 81755}, "thumbnail": "https://files.mastodon.social/site_uploads/files/000/000/001/@1x/57c12f441d083cde.png", + 2522485, "status_count": 120163210, "domain_count": 81770}, "thumbnail": "https://files.mastodon.social/site_uploads/files/000/000/001/@1x/57c12f441d083cde.png", "languages": ["en"], "registrations": true, "approval_required": false, "invites_enabled": true, "configuration": {"accounts": {"max_featured_tags": 10}, "statuses": {"max_characters": 500, "max_media_attachments": 4, "characters_reserved_per_url": @@ -41,8 +41,8 @@ interactions: "avatar_static": "https://files.mastodon.social/accounts/avatars/000/013/179/original/b4ceb19c9c54ec7e.png", "header": "https://files.mastodon.social/accounts/headers/000/013/179/original/1375be116fbe0f1d.png", "header_static": "https://files.mastodon.social/accounts/headers/000/013/179/original/1375be116fbe0f1d.png", - "followers_count": 837809, "following_count": 4, "statuses_count": 288, "last_status_at": - "2025-01-27", "hide_collections": false, "noindex": false, "emojis": [], "roles": + "followers_count": 837871, "following_count": 4, "statuses_count": 289, "last_status_at": + "2025-02-14", "hide_collections": false, "noindex": false, "emojis": [], "roles": [], "fields": [{"name": "Homepage", "value": "https://joinmastodon.org", @@ -84,11 +84,11 @@ interactions: Accept-Ranges: - bytes Age: - - '233' + - '221' Connection: - keep-alive Date: - - Fri, 14 Feb 2025 15:38:21 GMT + - Fri, 14 Feb 2025 22:39:47 GMT Strict-Transport-Security: - max-age=31557600 Vary: @@ -98,9 +98,9 @@ interactions: X-Cache-Hits: - 0, 5, 1 X-Served-By: - - cache-fra-eddf8230164-FRA, cache-fra-eddf8230152-FRA, cache-hel1410020-HEL + - cache-fra-eddf8230164-FRA, cache-fra-eddf8230152-FRA, cache-hel1410033-HEL X-Timer: - - S1739547501.466227,VS0,VE1 + - S1739572787.118459,VS0,VE1 alt-svc: - h3=":443";ma=86400,h3-29=":443";ma=86400,h3-27=":443";ma=86400 cache-control: @@ -112,7 +112,7 @@ interactions: content-type: - application/json; charset=utf-8 etag: - - W/"e83f947e4236ab50c372b04653b2c955" + - W/"bc38a058993fdbe29400795727e9d33c" referrer-policy: - same-origin via: @@ -124,13 +124,13 @@ interactions: x-ratelimit-limit: - '300' x-ratelimit-remaining: - - '173' + - '270' x-ratelimit-reset: - - '2025-02-14T15:35:00.651194Z' + - '2025-02-14T22:40:00.053698Z' x-request-id: - - 65e3ef547e7f34e6712a02c124593883 + - 8280556bb02fca4d6ed4a6da22529247 x-runtime: - - '0.266735' + - '0.032541' x-xss-protection: - '0' status: diff --git a/tests/cassettes_entity_tests/test_entity_instancestatusconfiguration.yaml b/tests/cassettes_entity_tests/test_entity_instancestatusconfiguration.yaml index ec065e7..1f12eba 100644 --- a/tests/cassettes_entity_tests/test_entity_instancestatusconfiguration.yaml +++ b/tests/cassettes_entity_tests/test_entity_instancestatusconfiguration.yaml @@ -1,4 +1,141 @@ interactions: +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Authorization: + - DUMMY + Connection: + - keep-alive + User-Agent: + - mastodonpy + method: GET + uri: https://mastodon.social/api/v1/instance/ + response: + body: + string: '{"uri": "mastodon.social", "title": "Mastodon", "short_description": + "The original server operated by the Mastodon gGmbH non-profit", "description": + "", "email": "staff@mastodon.social", "version": "4.4.0-nightly.2025-02-07", + "urls": {"streaming_api": "wss://streaming.mastodon.social"}, "stats": {"user_count": + 2522485, "status_count": 120163210, "domain_count": 81770}, "thumbnail": "https://files.mastodon.social/site_uploads/files/000/000/001/@1x/57c12f441d083cde.png", + "languages": ["en"], "registrations": true, "approval_required": false, "invites_enabled": + true, "configuration": {"accounts": {"max_featured_tags": 10}, "statuses": + {"max_characters": 500, "max_media_attachments": 4, "characters_reserved_per_url": + 23}, "media_attachments": {"supported_mime_types": ["image/jpeg", "image/png", + "image/gif", "image/heic", "image/heif", "image/webp", "image/avif", "video/webm", + "video/mp4", "video/quicktime", "video/ogg", "audio/wave", "audio/wav", "audio/x-wav", + "audio/x-pn-wave", "audio/vnd.wave", "audio/ogg", "audio/vorbis", "audio/mpeg", + "audio/mp3", "audio/webm", "audio/flac", "audio/aac", "audio/m4a", "audio/x-m4a", + "audio/mp4", "audio/3gpp", "video/x-ms-asf"], "image_size_limit": 16777216, + "image_matrix_limit": 33177600, "video_size_limit": 103809024, "video_frame_rate_limit": + 120, "video_matrix_limit": 8294400}, "polls": {"max_options": 4, "max_characters_per_option": + 50, "min_expiration": 300, "max_expiration": 2629746}}, "contact_account": + {"id": "13179", "username": "Mastodon", "acct": "Mastodon", "display_name": + "Mastodon", "locked": false, "bot": false, "discoverable": true, "indexable": + false, "group": false, "created_at": "2016-11-23T00:00:00.000Z", "note": "

Free, + open-source decentralized social media platform.

", "url": "https://mastodon.social/@Mastodon", + "uri": "https://mastodon.social/users/Mastodon", "avatar": "https://files.mastodon.social/accounts/avatars/000/013/179/original/b4ceb19c9c54ec7e.png", + "avatar_static": "https://files.mastodon.social/accounts/avatars/000/013/179/original/b4ceb19c9c54ec7e.png", + "header": "https://files.mastodon.social/accounts/headers/000/013/179/original/1375be116fbe0f1d.png", + "header_static": "https://files.mastodon.social/accounts/headers/000/013/179/original/1375be116fbe0f1d.png", + "followers_count": 837871, "following_count": 4, "statuses_count": 289, "last_status_at": + "2025-02-14", "hide_collections": false, "noindex": false, "emojis": [], "roles": + [], "fields": [{"name": "Homepage", "value": "https://joinmastodon.org", + "verified_at": "2018-10-31T04:11:00.076+00:00"}, {"name": "Patreon", "value": + "https://patreon.com/mastodon", + "verified_at": null}, {"name": "GitHub", "value": "https://github.com/mastodon", + "verified_at": "2023-07-21T13:27:45.996+00:00"}]}, "rules": [{"id": "1", "text": + "Sexually explicit or violent media must be marked as sensitive or with a + content warning", "hint": "This includes content that is particularly provocative + even if it may not show specific body parts, as well as dead bodies, bloody + injuries, and other gore. Particularly obscene content may be prohibited entirely. + Profile pictures and header images may not contain sexually explicit or violent + media."}, {"id": "2", "text": "No racism, sexism, homophobia, transphobia, + ableism, xenophobia, or casteism.", "hint": "Transphobic behavior such as + intentional misgendering and deadnaming is strictly prohibited. Promotion + of \"conversion therapy\" is strictly prohibited. Criticism of governments + and religions is permissible unless being used as a proxy for discrimination."}, + {"id": "3", "text": "No incitement of violence or promotion of violent ideologies", + "hint": "Calling for people or groups to be assassinated, murdered, or attacked + physically is strictly prohibited. Support for violent groups or events is + prohibited."}, {"id": "4", "text": "No harassment, block evasion, dogpiling, + or doxxing of others", "hint": "Repeat attempts to communicate with users + who have blocked you or creation of accounts solely to harass or insult individuals + is strictly prohibited. Coordinated activity to attack other users is prohibited. + Posting of private personal information about others is prohibited."}, {"id": + "7", "text": "Do not share information widely-known to be false and misleading", + "hint": "False and misleading information and links from low-quality sources + may not be posted, especially if they are likely to mislead or confuse others + or endanger their safety."}, {"id": "1008", "text": "Content created by others + must be attributed, and use of generative AI must be disclosed", "hint": "Content + created by others must clearly provide a reference to the author, creator, + or source. For adult content, this should include performers. Accounts may + not solely post AI-generated content."}]}' + headers: + Accept-Ranges: + - bytes + Age: + - '222' + Connection: + - keep-alive + Date: + - Fri, 14 Feb 2025 22:39:47 GMT + Strict-Transport-Security: + - max-age=31557600 + Vary: + - Accept, Origin, Accept-Encoding + X-Cache: + - MISS, HIT, HIT + X-Cache-Hits: + - 0, 5, 1 + X-Served-By: + - cache-fra-eddf8230164-FRA, cache-fra-eddf8230152-FRA, cache-hel1410022-HEL + X-Timer: + - S1739572788.902454,VS0,VE1 + alt-svc: + - h3=":443";ma=86400,h3-29=":443";ma=86400,h3-27=":443";ma=86400 + cache-control: + - max-age=300, public, stale-while-revalidate=30, stale-if-error=86400 + content-length: + - '5442' + content-security-policy: + - default-src 'none'; frame-ancestors 'none'; form-action 'none' + content-type: + - application/json; charset=utf-8 + etag: + - W/"bc38a058993fdbe29400795727e9d33c" + referrer-policy: + - same-origin + via: + - 1.1 varnish, 1.1 varnish, 1.1 varnish + x-content-type-options: + - nosniff + x-frame-options: + - DENY + x-ratelimit-limit: + - '300' + x-ratelimit-remaining: + - '270' + x-ratelimit-reset: + - '2025-02-14T22:40:00.053698Z' + x-request-id: + - 8280556bb02fca4d6ed4a6da22529247 + x-runtime: + - '0.032541' + x-xss-protection: + - '0' + status: + code: 200 + message: OK - request: body: null headers: @@ -56,8 +193,8 @@ interactions: "avatar_static": "https://files.mastodon.social/accounts/avatars/000/013/179/original/b4ceb19c9c54ec7e.png", "header": "https://files.mastodon.social/accounts/headers/000/013/179/original/1375be116fbe0f1d.png", "header_static": "https://files.mastodon.social/accounts/headers/000/013/179/original/1375be116fbe0f1d.png", - "followers_count": 837809, "following_count": 4, "statuses_count": 288, "last_status_at": - "2025-01-27", "hide_collections": false, "noindex": false, "emojis": [], "roles": + "followers_count": 837872, "following_count": 4, "statuses_count": 289, "last_status_at": + "2025-02-14", "hide_collections": false, "noindex": false, "emojis": [], "roles": [], "fields": [{"name": "Homepage", "value": "https://joinmastodon.org", @@ -103,7 +240,7 @@ interactions: Connection: - keep-alive Date: - - Fri, 14 Feb 2025 15:38:22 GMT + - Fri, 14 Feb 2025 22:39:47 GMT Strict-Transport-Security: - max-age=31557600 Vary: @@ -113,9 +250,9 @@ interactions: X-Cache-Hits: - 0, 0, 2 X-Served-By: - - cache-fra-etou8220030-FRA, cache-fra-etou8220030-FRA, cache-hel1410031-HEL + - cache-fra-etou8220040-FRA, cache-fra-etou8220030-FRA, cache-hel1410022-HEL X-Timer: - - S1739547502.042645,VS0,VE0 + - S1739572788.948563,VS0,VE0 alt-svc: - h3=":443";ma=86400,h3-29=":443";ma=86400,h3-27=":443";ma=86400 cache-control: @@ -127,7 +264,7 @@ interactions: content-type: - application/json; charset=utf-8 etag: - - W/"551fae2c400427901fea0abc350f319e" + - W/"baea7f6f665258ec0ad4fd954447a184" referrer-policy: - same-origin via: @@ -139,13 +276,13 @@ interactions: x-ratelimit-limit: - '300' x-ratelimit-remaining: - - '283' + - '298' x-ratelimit-reset: - - '2025-02-14T15:40:00.797193Z' + - '2025-02-14T22:40:00.379655Z' x-request-id: - - d0c06378678677c73ba1d406ec7a294b + - e488feea20c504741068107e2a536dd1 x-runtime: - - '0.024948' + - '0.032660' x-xss-protection: - '0' status: diff --git a/tests/cassettes_entity_tests/test_entity_instancethumbnail.yaml b/tests/cassettes_entity_tests/test_entity_instancethumbnail.yaml index 6764612..b99666d 100644 --- a/tests/cassettes_entity_tests/test_entity_instancethumbnail.yaml +++ b/tests/cassettes_entity_tests/test_entity_instancethumbnail.yaml @@ -1,4 +1,141 @@ interactions: +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Authorization: + - DUMMY + Connection: + - keep-alive + User-Agent: + - mastodonpy + method: GET + uri: https://mastodon.social/api/v1/instance/ + response: + body: + string: '{"uri": "mastodon.social", "title": "Mastodon", "short_description": + "The original server operated by the Mastodon gGmbH non-profit", "description": + "", "email": "staff@mastodon.social", "version": "4.4.0-nightly.2025-02-07", + "urls": {"streaming_api": "wss://streaming.mastodon.social"}, "stats": {"user_count": + 2522485, "status_count": 120163210, "domain_count": 81770}, "thumbnail": "https://files.mastodon.social/site_uploads/files/000/000/001/@1x/57c12f441d083cde.png", + "languages": ["en"], "registrations": true, "approval_required": false, "invites_enabled": + true, "configuration": {"accounts": {"max_featured_tags": 10}, "statuses": + {"max_characters": 500, "max_media_attachments": 4, "characters_reserved_per_url": + 23}, "media_attachments": {"supported_mime_types": ["image/jpeg", "image/png", + "image/gif", "image/heic", "image/heif", "image/webp", "image/avif", "video/webm", + "video/mp4", "video/quicktime", "video/ogg", "audio/wave", "audio/wav", "audio/x-wav", + "audio/x-pn-wave", "audio/vnd.wave", "audio/ogg", "audio/vorbis", "audio/mpeg", + "audio/mp3", "audio/webm", "audio/flac", "audio/aac", "audio/m4a", "audio/x-m4a", + "audio/mp4", "audio/3gpp", "video/x-ms-asf"], "image_size_limit": 16777216, + "image_matrix_limit": 33177600, "video_size_limit": 103809024, "video_frame_rate_limit": + 120, "video_matrix_limit": 8294400}, "polls": {"max_options": 4, "max_characters_per_option": + 50, "min_expiration": 300, "max_expiration": 2629746}}, "contact_account": + {"id": "13179", "username": "Mastodon", "acct": "Mastodon", "display_name": + "Mastodon", "locked": false, "bot": false, "discoverable": true, "indexable": + false, "group": false, "created_at": "2016-11-23T00:00:00.000Z", "note": "

Free, + open-source decentralized social media platform.

", "url": "https://mastodon.social/@Mastodon", + "uri": "https://mastodon.social/users/Mastodon", "avatar": "https://files.mastodon.social/accounts/avatars/000/013/179/original/b4ceb19c9c54ec7e.png", + "avatar_static": "https://files.mastodon.social/accounts/avatars/000/013/179/original/b4ceb19c9c54ec7e.png", + "header": "https://files.mastodon.social/accounts/headers/000/013/179/original/1375be116fbe0f1d.png", + "header_static": "https://files.mastodon.social/accounts/headers/000/013/179/original/1375be116fbe0f1d.png", + "followers_count": 837871, "following_count": 4, "statuses_count": 289, "last_status_at": + "2025-02-14", "hide_collections": false, "noindex": false, "emojis": [], "roles": + [], "fields": [{"name": "Homepage", "value": "https://joinmastodon.org", + "verified_at": "2018-10-31T04:11:00.076+00:00"}, {"name": "Patreon", "value": + "https://patreon.com/mastodon", + "verified_at": null}, {"name": "GitHub", "value": "https://github.com/mastodon", + "verified_at": "2023-07-21T13:27:45.996+00:00"}]}, "rules": [{"id": "1", "text": + "Sexually explicit or violent media must be marked as sensitive or with a + content warning", "hint": "This includes content that is particularly provocative + even if it may not show specific body parts, as well as dead bodies, bloody + injuries, and other gore. Particularly obscene content may be prohibited entirely. + Profile pictures and header images may not contain sexually explicit or violent + media."}, {"id": "2", "text": "No racism, sexism, homophobia, transphobia, + ableism, xenophobia, or casteism.", "hint": "Transphobic behavior such as + intentional misgendering and deadnaming is strictly prohibited. Promotion + of \"conversion therapy\" is strictly prohibited. Criticism of governments + and religions is permissible unless being used as a proxy for discrimination."}, + {"id": "3", "text": "No incitement of violence or promotion of violent ideologies", + "hint": "Calling for people or groups to be assassinated, murdered, or attacked + physically is strictly prohibited. Support for violent groups or events is + prohibited."}, {"id": "4", "text": "No harassment, block evasion, dogpiling, + or doxxing of others", "hint": "Repeat attempts to communicate with users + who have blocked you or creation of accounts solely to harass or insult individuals + is strictly prohibited. Coordinated activity to attack other users is prohibited. + Posting of private personal information about others is prohibited."}, {"id": + "7", "text": "Do not share information widely-known to be false and misleading", + "hint": "False and misleading information and links from low-quality sources + may not be posted, especially if they are likely to mislead or confuse others + or endanger their safety."}, {"id": "1008", "text": "Content created by others + must be attributed, and use of generative AI must be disclosed", "hint": "Content + created by others must clearly provide a reference to the author, creator, + or source. For adult content, this should include performers. Accounts may + not solely post AI-generated content."}]}' + headers: + Accept-Ranges: + - bytes + Age: + - '221' + Connection: + - keep-alive + Date: + - Fri, 14 Feb 2025 22:39:46 GMT + Strict-Transport-Security: + - max-age=31557600 + Vary: + - Accept, Origin, Accept-Encoding + X-Cache: + - MISS, HIT, HIT + X-Cache-Hits: + - 0, 5, 0 + X-Served-By: + - cache-fra-eddf8230164-FRA, cache-fra-eddf8230152-FRA, cache-hel1410028-HEL + X-Timer: + - S1739572787.886371,VS0,VE1 + alt-svc: + - h3=":443";ma=86400,h3-29=":443";ma=86400,h3-27=":443";ma=86400 + cache-control: + - max-age=300, public, stale-while-revalidate=30, stale-if-error=86400 + content-length: + - '5442' + content-security-policy: + - default-src 'none'; frame-ancestors 'none'; form-action 'none' + content-type: + - application/json; charset=utf-8 + etag: + - W/"bc38a058993fdbe29400795727e9d33c" + referrer-policy: + - same-origin + via: + - 1.1 varnish, 1.1 varnish, 1.1 varnish + x-content-type-options: + - nosniff + x-frame-options: + - DENY + x-ratelimit-limit: + - '300' + x-ratelimit-remaining: + - '270' + x-ratelimit-reset: + - '2025-02-14T22:40:00.053698Z' + x-request-id: + - 8280556bb02fca4d6ed4a6da22529247 + x-runtime: + - '0.032541' + x-xss-protection: + - '0' + status: + code: 200 + message: OK - request: body: null headers: @@ -56,8 +193,8 @@ interactions: "avatar_static": "https://files.mastodon.social/accounts/avatars/000/013/179/original/b4ceb19c9c54ec7e.png", "header": "https://files.mastodon.social/accounts/headers/000/013/179/original/1375be116fbe0f1d.png", "header_static": "https://files.mastodon.social/accounts/headers/000/013/179/original/1375be116fbe0f1d.png", - "followers_count": 837809, "following_count": 4, "statuses_count": 288, "last_status_at": - "2025-01-27", "hide_collections": false, "noindex": false, "emojis": [], "roles": + "followers_count": 837872, "following_count": 4, "statuses_count": 289, "last_status_at": + "2025-02-14", "hide_collections": false, "noindex": false, "emojis": [], "roles": [], "fields": [{"name": "Homepage", "value": "https://joinmastodon.org", @@ -103,7 +240,7 @@ interactions: Connection: - keep-alive Date: - - Fri, 14 Feb 2025 15:38:21 GMT + - Fri, 14 Feb 2025 22:39:46 GMT Strict-Transport-Security: - max-age=31557600 Vary: @@ -111,11 +248,11 @@ interactions: X-Cache: - MISS, MISS, HIT X-Cache-Hits: - - 0, 0, 1 + - 0, 0, 2 X-Served-By: - - cache-fra-etou8220030-FRA, cache-fra-etou8220030-FRA, cache-hel1410029-HEL + - cache-fra-etou8220040-FRA, cache-fra-etou8220030-FRA, cache-hel1410028-HEL X-Timer: - - S1739547501.260205,VS0,VE1 + - S1739572787.918525,VS0,VE0 alt-svc: - h3=":443";ma=86400,h3-29=":443";ma=86400,h3-27=":443";ma=86400 cache-control: @@ -127,7 +264,7 @@ interactions: content-type: - application/json; charset=utf-8 etag: - - W/"551fae2c400427901fea0abc350f319e" + - W/"baea7f6f665258ec0ad4fd954447a184" referrer-policy: - same-origin via: @@ -139,13 +276,13 @@ interactions: x-ratelimit-limit: - '300' x-ratelimit-remaining: - - '283' + - '298' x-ratelimit-reset: - - '2025-02-14T15:40:00.797193Z' + - '2025-02-14T22:40:00.379655Z' x-request-id: - - d0c06378678677c73ba1d406ec7a294b + - e488feea20c504741068107e2a536dd1 x-runtime: - - '0.024948' + - '0.032660' x-xss-protection: - '0' status: diff --git a/tests/cassettes_entity_tests/test_entity_instancethumbnailversions.yaml b/tests/cassettes_entity_tests/test_entity_instancethumbnailversions.yaml index 5d3d152..e884ae2 100644 --- a/tests/cassettes_entity_tests/test_entity_instancethumbnailversions.yaml +++ b/tests/cassettes_entity_tests/test_entity_instancethumbnailversions.yaml @@ -1,4 +1,141 @@ interactions: +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Authorization: + - DUMMY + Connection: + - keep-alive + User-Agent: + - mastodonpy + method: GET + uri: https://mastodon.social/api/v1/instance/ + response: + body: + string: '{"uri": "mastodon.social", "title": "Mastodon", "short_description": + "The original server operated by the Mastodon gGmbH non-profit", "description": + "", "email": "staff@mastodon.social", "version": "4.4.0-nightly.2025-02-07", + "urls": {"streaming_api": "wss://streaming.mastodon.social"}, "stats": {"user_count": + 2522485, "status_count": 120163210, "domain_count": 81770}, "thumbnail": "https://files.mastodon.social/site_uploads/files/000/000/001/@1x/57c12f441d083cde.png", + "languages": ["en"], "registrations": true, "approval_required": false, "invites_enabled": + true, "configuration": {"accounts": {"max_featured_tags": 10}, "statuses": + {"max_characters": 500, "max_media_attachments": 4, "characters_reserved_per_url": + 23}, "media_attachments": {"supported_mime_types": ["image/jpeg", "image/png", + "image/gif", "image/heic", "image/heif", "image/webp", "image/avif", "video/webm", + "video/mp4", "video/quicktime", "video/ogg", "audio/wave", "audio/wav", "audio/x-wav", + "audio/x-pn-wave", "audio/vnd.wave", "audio/ogg", "audio/vorbis", "audio/mpeg", + "audio/mp3", "audio/webm", "audio/flac", "audio/aac", "audio/m4a", "audio/x-m4a", + "audio/mp4", "audio/3gpp", "video/x-ms-asf"], "image_size_limit": 16777216, + "image_matrix_limit": 33177600, "video_size_limit": 103809024, "video_frame_rate_limit": + 120, "video_matrix_limit": 8294400}, "polls": {"max_options": 4, "max_characters_per_option": + 50, "min_expiration": 300, "max_expiration": 2629746}}, "contact_account": + {"id": "13179", "username": "Mastodon", "acct": "Mastodon", "display_name": + "Mastodon", "locked": false, "bot": false, "discoverable": true, "indexable": + false, "group": false, "created_at": "2016-11-23T00:00:00.000Z", "note": "

Free, + open-source decentralized social media platform.

", "url": "https://mastodon.social/@Mastodon", + "uri": "https://mastodon.social/users/Mastodon", "avatar": "https://files.mastodon.social/accounts/avatars/000/013/179/original/b4ceb19c9c54ec7e.png", + "avatar_static": "https://files.mastodon.social/accounts/avatars/000/013/179/original/b4ceb19c9c54ec7e.png", + "header": "https://files.mastodon.social/accounts/headers/000/013/179/original/1375be116fbe0f1d.png", + "header_static": "https://files.mastodon.social/accounts/headers/000/013/179/original/1375be116fbe0f1d.png", + "followers_count": 837871, "following_count": 4, "statuses_count": 289, "last_status_at": + "2025-02-14", "hide_collections": false, "noindex": false, "emojis": [], "roles": + [], "fields": [{"name": "Homepage", "value": "https://joinmastodon.org", + "verified_at": "2018-10-31T04:11:00.076+00:00"}, {"name": "Patreon", "value": + "https://patreon.com/mastodon", + "verified_at": null}, {"name": "GitHub", "value": "https://github.com/mastodon", + "verified_at": "2023-07-21T13:27:45.996+00:00"}]}, "rules": [{"id": "1", "text": + "Sexually explicit or violent media must be marked as sensitive or with a + content warning", "hint": "This includes content that is particularly provocative + even if it may not show specific body parts, as well as dead bodies, bloody + injuries, and other gore. Particularly obscene content may be prohibited entirely. + Profile pictures and header images may not contain sexually explicit or violent + media."}, {"id": "2", "text": "No racism, sexism, homophobia, transphobia, + ableism, xenophobia, or casteism.", "hint": "Transphobic behavior such as + intentional misgendering and deadnaming is strictly prohibited. Promotion + of \"conversion therapy\" is strictly prohibited. Criticism of governments + and religions is permissible unless being used as a proxy for discrimination."}, + {"id": "3", "text": "No incitement of violence or promotion of violent ideologies", + "hint": "Calling for people or groups to be assassinated, murdered, or attacked + physically is strictly prohibited. Support for violent groups or events is + prohibited."}, {"id": "4", "text": "No harassment, block evasion, dogpiling, + or doxxing of others", "hint": "Repeat attempts to communicate with users + who have blocked you or creation of accounts solely to harass or insult individuals + is strictly prohibited. Coordinated activity to attack other users is prohibited. + Posting of private personal information about others is prohibited."}, {"id": + "7", "text": "Do not share information widely-known to be false and misleading", + "hint": "False and misleading information and links from low-quality sources + may not be posted, especially if they are likely to mislead or confuse others + or endanger their safety."}, {"id": "1008", "text": "Content created by others + must be attributed, and use of generative AI must be disclosed", "hint": "Content + created by others must clearly provide a reference to the author, creator, + or source. For adult content, this should include performers. Accounts may + not solely post AI-generated content."}]}' + headers: + Accept-Ranges: + - bytes + Age: + - '221' + Connection: + - keep-alive + Date: + - Fri, 14 Feb 2025 22:39:47 GMT + Strict-Transport-Security: + - max-age=31557600 + Vary: + - Accept, Origin, Accept-Encoding + X-Cache: + - MISS, HIT, HIT + X-Cache-Hits: + - 0, 5, 1 + X-Served-By: + - cache-fra-eddf8230164-FRA, cache-fra-eddf8230152-FRA, cache-hel1410020-HEL + X-Timer: + - S1739572787.003751,VS0,VE1 + alt-svc: + - h3=":443";ma=86400,h3-29=":443";ma=86400,h3-27=":443";ma=86400 + cache-control: + - max-age=300, public, stale-while-revalidate=30, stale-if-error=86400 + content-length: + - '5442' + content-security-policy: + - default-src 'none'; frame-ancestors 'none'; form-action 'none' + content-type: + - application/json; charset=utf-8 + etag: + - W/"bc38a058993fdbe29400795727e9d33c" + referrer-policy: + - same-origin + via: + - 1.1 varnish, 1.1 varnish, 1.1 varnish + x-content-type-options: + - nosniff + x-frame-options: + - DENY + x-ratelimit-limit: + - '300' + x-ratelimit-remaining: + - '270' + x-ratelimit-reset: + - '2025-02-14T22:40:00.053698Z' + x-request-id: + - 8280556bb02fca4d6ed4a6da22529247 + x-runtime: + - '0.032541' + x-xss-protection: + - '0' + status: + code: 200 + message: OK - request: body: null headers: @@ -56,8 +193,8 @@ interactions: "avatar_static": "https://files.mastodon.social/accounts/avatars/000/013/179/original/b4ceb19c9c54ec7e.png", "header": "https://files.mastodon.social/accounts/headers/000/013/179/original/1375be116fbe0f1d.png", "header_static": "https://files.mastodon.social/accounts/headers/000/013/179/original/1375be116fbe0f1d.png", - "followers_count": 837809, "following_count": 4, "statuses_count": 288, "last_status_at": - "2025-01-27", "hide_collections": false, "noindex": false, "emojis": [], "roles": + "followers_count": 837872, "following_count": 4, "statuses_count": 289, "last_status_at": + "2025-02-14", "hide_collections": false, "noindex": false, "emojis": [], "roles": [], "fields": [{"name": "Homepage", "value": "https://joinmastodon.org", @@ -103,7 +240,7 @@ interactions: Connection: - keep-alive Date: - - Fri, 14 Feb 2025 15:38:21 GMT + - Fri, 14 Feb 2025 22:39:47 GMT Strict-Transport-Security: - max-age=31557600 Vary: @@ -113,9 +250,9 @@ interactions: X-Cache-Hits: - 0, 0, 1 X-Served-By: - - cache-fra-etou8220030-FRA, cache-fra-etou8220030-FRA, cache-hel1410030-HEL + - cache-fra-etou8220040-FRA, cache-fra-etou8220030-FRA, cache-hel1410020-HEL X-Timer: - - S1739547501.368715,VS0,VE3 + - S1739572787.036696,VS0,VE1 alt-svc: - h3=":443";ma=86400,h3-29=":443";ma=86400,h3-27=":443";ma=86400 cache-control: @@ -127,7 +264,7 @@ interactions: content-type: - application/json; charset=utf-8 etag: - - W/"551fae2c400427901fea0abc350f319e" + - W/"baea7f6f665258ec0ad4fd954447a184" referrer-policy: - same-origin via: @@ -139,13 +276,13 @@ interactions: x-ratelimit-limit: - '300' x-ratelimit-remaining: - - '283' + - '298' x-ratelimit-reset: - - '2025-02-14T15:40:00.797193Z' + - '2025-02-14T22:40:00.379655Z' x-request-id: - - d0c06378678677c73ba1d406ec7a294b + - e488feea20c504741068107e2a536dd1 x-runtime: - - '0.024948' + - '0.032660' x-xss-protection: - '0' status: diff --git a/tests/cassettes_entity_tests/test_entity_instancetranslationconfiguration.yaml b/tests/cassettes_entity_tests/test_entity_instancetranslationconfiguration.yaml index 02cf19b..14314eb 100644 --- a/tests/cassettes_entity_tests/test_entity_instancetranslationconfiguration.yaml +++ b/tests/cassettes_entity_tests/test_entity_instancetranslationconfiguration.yaml @@ -56,8 +56,8 @@ interactions: "avatar_static": "https://files.mastodon.social/accounts/avatars/000/013/179/original/b4ceb19c9c54ec7e.png", "header": "https://files.mastodon.social/accounts/headers/000/013/179/original/1375be116fbe0f1d.png", "header_static": "https://files.mastodon.social/accounts/headers/000/013/179/original/1375be116fbe0f1d.png", - "followers_count": 837809, "following_count": 4, "statuses_count": 288, "last_status_at": - "2025-01-27", "hide_collections": false, "noindex": false, "emojis": [], "roles": + "followers_count": 837872, "following_count": 4, "statuses_count": 289, "last_status_at": + "2025-02-14", "hide_collections": false, "noindex": false, "emojis": [], "roles": [], "fields": [{"name": "Homepage", "value": "https://joinmastodon.org", @@ -103,7 +103,7 @@ interactions: Connection: - keep-alive Date: - - Fri, 14 Feb 2025 15:38:22 GMT + - Fri, 14 Feb 2025 22:39:48 GMT Strict-Transport-Security: - max-age=31557600 Vary: @@ -111,11 +111,11 @@ interactions: X-Cache: - MISS, MISS, HIT X-Cache-Hits: - - 0, 0, 1 + - 0, 0, 3 X-Served-By: - - cache-fra-etou8220030-FRA, cache-fra-etou8220030-FRA, cache-hel1410022-HEL + - cache-fra-etou8220040-FRA, cache-fra-etou8220030-FRA, cache-hel1410022-HEL X-Timer: - - S1739547502.108825,VS0,VE1 + - S1739572788.040717,VS0,VE0 alt-svc: - h3=":443";ma=86400,h3-29=":443";ma=86400,h3-27=":443";ma=86400 cache-control: @@ -127,7 +127,7 @@ interactions: content-type: - application/json; charset=utf-8 etag: - - W/"551fae2c400427901fea0abc350f319e" + - W/"baea7f6f665258ec0ad4fd954447a184" referrer-policy: - same-origin via: @@ -139,13 +139,13 @@ interactions: x-ratelimit-limit: - '300' x-ratelimit-remaining: - - '283' + - '298' x-ratelimit-reset: - - '2025-02-14T15:40:00.797193Z' + - '2025-02-14T22:40:00.379655Z' x-request-id: - - d0c06378678677c73ba1d406ec7a294b + - e488feea20c504741068107e2a536dd1 x-runtime: - - '0.024948' + - '0.032660' x-xss-protection: - '0' status: diff --git a/tests/cassettes_entity_tests/test_entity_instanceurls.yaml b/tests/cassettes_entity_tests/test_entity_instanceurls.yaml index cd100e7..fa9cd68 100644 --- a/tests/cassettes_entity_tests/test_entity_instanceurls.yaml +++ b/tests/cassettes_entity_tests/test_entity_instanceurls.yaml @@ -20,7 +20,7 @@ interactions: "The original server operated by the Mastodon gGmbH non-profit", "description": "", "email": "staff@mastodon.social", "version": "4.4.0-nightly.2025-02-07", "urls": {"streaming_api": "wss://streaming.mastodon.social"}, "stats": {"user_count": - 2521623, "status_count": 120126443, "domain_count": 81755}, "thumbnail": "https://files.mastodon.social/site_uploads/files/000/000/001/@1x/57c12f441d083cde.png", + 2522485, "status_count": 120163210, "domain_count": 81770}, "thumbnail": "https://files.mastodon.social/site_uploads/files/000/000/001/@1x/57c12f441d083cde.png", "languages": ["en"], "registrations": true, "approval_required": false, "invites_enabled": true, "configuration": {"accounts": {"max_featured_tags": 10}, "statuses": {"max_characters": 500, "max_media_attachments": 4, "characters_reserved_per_url": @@ -41,8 +41,8 @@ interactions: "avatar_static": "https://files.mastodon.social/accounts/avatars/000/013/179/original/b4ceb19c9c54ec7e.png", "header": "https://files.mastodon.social/accounts/headers/000/013/179/original/1375be116fbe0f1d.png", "header_static": "https://files.mastodon.social/accounts/headers/000/013/179/original/1375be116fbe0f1d.png", - "followers_count": 837809, "following_count": 4, "statuses_count": 288, "last_status_at": - "2025-01-27", "hide_collections": false, "noindex": false, "emojis": [], "roles": + "followers_count": 837871, "following_count": 4, "statuses_count": 289, "last_status_at": + "2025-02-14", "hide_collections": false, "noindex": false, "emojis": [], "roles": [], "fields": [{"name": "Homepage", "value": "https://joinmastodon.org", @@ -84,11 +84,11 @@ interactions: Accept-Ranges: - bytes Age: - - '233' + - '220' Connection: - keep-alive Date: - - Fri, 14 Feb 2025 15:38:20 GMT + - Fri, 14 Feb 2025 22:39:46 GMT Strict-Transport-Security: - max-age=31557600 Vary: @@ -96,11 +96,11 @@ interactions: X-Cache: - MISS, HIT, HIT X-Cache-Hits: - - 0, 5, 1 + - 0, 5, 2 X-Served-By: - - cache-fra-eddf8230164-FRA, cache-fra-eddf8230152-FRA, cache-hel1410027-HEL + - cache-fra-eddf8230164-FRA, cache-fra-eddf8230152-FRA, cache-hel1410021-HEL X-Timer: - - S1739547501.592523,VS0,VE1 + - S1739572786.211966,VS0,VE0 alt-svc: - h3=":443";ma=86400,h3-29=":443";ma=86400,h3-27=":443";ma=86400 cache-control: @@ -112,7 +112,7 @@ interactions: content-type: - application/json; charset=utf-8 etag: - - W/"e83f947e4236ab50c372b04653b2c955" + - W/"bc38a058993fdbe29400795727e9d33c" referrer-policy: - same-origin via: @@ -124,13 +124,13 @@ interactions: x-ratelimit-limit: - '300' x-ratelimit-remaining: - - '173' + - '270' x-ratelimit-reset: - - '2025-02-14T15:35:00.651194Z' + - '2025-02-14T22:40:00.053698Z' x-request-id: - - 65e3ef547e7f34e6712a02c124593883 + - 8280556bb02fca4d6ed4a6da22529247 x-runtime: - - '0.266735' + - '0.032541' x-xss-protection: - '0' status: @@ -157,7 +157,7 @@ interactions: "The original server operated by the Mastodon gGmbH non-profit", "description": "", "email": "staff@mastodon.social", "version": "4.4.0-nightly.2025-02-07", "urls": {"streaming_api": "wss://streaming.mastodon.social"}, "stats": {"user_count": - 2521623, "status_count": 120126443, "domain_count": 81755}, "thumbnail": "https://files.mastodon.social/site_uploads/files/000/000/001/@1x/57c12f441d083cde.png", + 2522485, "status_count": 120163210, "domain_count": 81770}, "thumbnail": "https://files.mastodon.social/site_uploads/files/000/000/001/@1x/57c12f441d083cde.png", "languages": ["en"], "registrations": true, "approval_required": false, "invites_enabled": true, "configuration": {"accounts": {"max_featured_tags": 10}, "statuses": {"max_characters": 500, "max_media_attachments": 4, "characters_reserved_per_url": @@ -178,8 +178,8 @@ interactions: "avatar_static": "https://files.mastodon.social/accounts/avatars/000/013/179/original/b4ceb19c9c54ec7e.png", "header": "https://files.mastodon.social/accounts/headers/000/013/179/original/1375be116fbe0f1d.png", "header_static": "https://files.mastodon.social/accounts/headers/000/013/179/original/1375be116fbe0f1d.png", - "followers_count": 837809, "following_count": 4, "statuses_count": 288, "last_status_at": - "2025-01-27", "hide_collections": false, "noindex": false, "emojis": [], "roles": + "followers_count": 837871, "following_count": 4, "statuses_count": 289, "last_status_at": + "2025-02-14", "hide_collections": false, "noindex": false, "emojis": [], "roles": [], "fields": [{"name": "Homepage", "value": "https://joinmastodon.org", @@ -221,11 +221,11 @@ interactions: Accept-Ranges: - bytes Age: - - '233' + - '220' Connection: - keep-alive Date: - - Fri, 14 Feb 2025 15:38:20 GMT + - Fri, 14 Feb 2025 22:39:46 GMT Strict-Transport-Security: - max-age=31557600 Vary: @@ -233,11 +233,11 @@ interactions: X-Cache: - MISS, HIT, HIT X-Cache-Hits: - - 0, 5, 2 + - 0, 5, 3 X-Served-By: - - cache-fra-eddf8230164-FRA, cache-fra-eddf8230152-FRA, cache-hel1410027-HEL + - cache-fra-eddf8230164-FRA, cache-fra-eddf8230152-FRA, cache-hel1410021-HEL X-Timer: - - S1739547501.624411,VS0,VE0 + - S1739572786.244080,VS0,VE0 alt-svc: - h3=":443";ma=86400,h3-29=":443";ma=86400,h3-27=":443";ma=86400 cache-control: @@ -249,7 +249,7 @@ interactions: content-type: - application/json; charset=utf-8 etag: - - W/"e83f947e4236ab50c372b04653b2c955" + - W/"bc38a058993fdbe29400795727e9d33c" referrer-policy: - same-origin via: @@ -261,13 +261,13 @@ interactions: x-ratelimit-limit: - '300' x-ratelimit-remaining: - - '173' + - '270' x-ratelimit-reset: - - '2025-02-14T15:35:00.651194Z' + - '2025-02-14T22:40:00.053698Z' x-request-id: - - 65e3ef547e7f34e6712a02c124593883 + - 8280556bb02fca4d6ed4a6da22529247 x-runtime: - - '0.266735' + - '0.032541' x-xss-protection: - '0' status: diff --git a/tests/cassettes_entity_tests/test_entity_instanceurlsv2.yaml b/tests/cassettes_entity_tests/test_entity_instanceurlsv2.yaml index 95b1deb..9af0f1d 100644 --- a/tests/cassettes_entity_tests/test_entity_instanceurlsv2.yaml +++ b/tests/cassettes_entity_tests/test_entity_instanceurlsv2.yaml @@ -56,8 +56,8 @@ interactions: "avatar_static": "https://files.mastodon.social/accounts/avatars/000/013/179/original/b4ceb19c9c54ec7e.png", "header": "https://files.mastodon.social/accounts/headers/000/013/179/original/1375be116fbe0f1d.png", "header_static": "https://files.mastodon.social/accounts/headers/000/013/179/original/1375be116fbe0f1d.png", - "followers_count": 837809, "following_count": 4, "statuses_count": 288, "last_status_at": - "2025-01-27", "hide_collections": false, "noindex": false, "emojis": [], "roles": + "followers_count": 837872, "following_count": 4, "statuses_count": 289, "last_status_at": + "2025-02-14", "hide_collections": false, "noindex": false, "emojis": [], "roles": [], "fields": [{"name": "Homepage", "value": "https://joinmastodon.org", @@ -103,7 +103,7 @@ interactions: Connection: - keep-alive Date: - - Fri, 14 Feb 2025 15:38:21 GMT + - Fri, 14 Feb 2025 22:39:46 GMT Strict-Transport-Security: - max-age=31557600 Vary: @@ -113,9 +113,9 @@ interactions: X-Cache-Hits: - 0, 0, 1 X-Served-By: - - cache-fra-etou8220030-FRA, cache-fra-etou8220030-FRA, cache-hel1410025-HEL + - cache-fra-etou8220040-FRA, cache-fra-etou8220030-FRA, cache-hel1410028-HEL X-Timer: - - S1739547501.180552,VS0,VE1 + - S1739572787.808422,VS0,VE1 alt-svc: - h3=":443";ma=86400,h3-29=":443";ma=86400,h3-27=":443";ma=86400 cache-control: @@ -127,7 +127,7 @@ interactions: content-type: - application/json; charset=utf-8 etag: - - W/"551fae2c400427901fea0abc350f319e" + - W/"baea7f6f665258ec0ad4fd954447a184" referrer-policy: - same-origin via: @@ -139,13 +139,13 @@ interactions: x-ratelimit-limit: - '300' x-ratelimit-remaining: - - '283' + - '298' x-ratelimit-reset: - - '2025-02-14T15:40:00.797193Z' + - '2025-02-14T22:40:00.379655Z' x-request-id: - - d0c06378678677c73ba1d406ec7a294b + - e488feea20c504741068107e2a536dd1 x-runtime: - - '0.024948' + - '0.032660' x-xss-protection: - '0' status: diff --git a/tests/cassettes_entity_tests/test_entity_instanceusage.yaml b/tests/cassettes_entity_tests/test_entity_instanceusage.yaml index 887e7c8..04e798a 100644 --- a/tests/cassettes_entity_tests/test_entity_instanceusage.yaml +++ b/tests/cassettes_entity_tests/test_entity_instanceusage.yaml @@ -1,4 +1,141 @@ interactions: +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Authorization: + - DUMMY + Connection: + - keep-alive + User-Agent: + - mastodonpy + method: GET + uri: https://mastodon.social/api/v1/instance/ + response: + body: + string: '{"uri": "mastodon.social", "title": "Mastodon", "short_description": + "The original server operated by the Mastodon gGmbH non-profit", "description": + "", "email": "staff@mastodon.social", "version": "4.4.0-nightly.2025-02-07", + "urls": {"streaming_api": "wss://streaming.mastodon.social"}, "stats": {"user_count": + 2522485, "status_count": 120163210, "domain_count": 81770}, "thumbnail": "https://files.mastodon.social/site_uploads/files/000/000/001/@1x/57c12f441d083cde.png", + "languages": ["en"], "registrations": true, "approval_required": false, "invites_enabled": + true, "configuration": {"accounts": {"max_featured_tags": 10}, "statuses": + {"max_characters": 500, "max_media_attachments": 4, "characters_reserved_per_url": + 23}, "media_attachments": {"supported_mime_types": ["image/jpeg", "image/png", + "image/gif", "image/heic", "image/heif", "image/webp", "image/avif", "video/webm", + "video/mp4", "video/quicktime", "video/ogg", "audio/wave", "audio/wav", "audio/x-wav", + "audio/x-pn-wave", "audio/vnd.wave", "audio/ogg", "audio/vorbis", "audio/mpeg", + "audio/mp3", "audio/webm", "audio/flac", "audio/aac", "audio/m4a", "audio/x-m4a", + "audio/mp4", "audio/3gpp", "video/x-ms-asf"], "image_size_limit": 16777216, + "image_matrix_limit": 33177600, "video_size_limit": 103809024, "video_frame_rate_limit": + 120, "video_matrix_limit": 8294400}, "polls": {"max_options": 4, "max_characters_per_option": + 50, "min_expiration": 300, "max_expiration": 2629746}}, "contact_account": + {"id": "13179", "username": "Mastodon", "acct": "Mastodon", "display_name": + "Mastodon", "locked": false, "bot": false, "discoverable": true, "indexable": + false, "group": false, "created_at": "2016-11-23T00:00:00.000Z", "note": "

Free, + open-source decentralized social media platform.

", "url": "https://mastodon.social/@Mastodon", + "uri": "https://mastodon.social/users/Mastodon", "avatar": "https://files.mastodon.social/accounts/avatars/000/013/179/original/b4ceb19c9c54ec7e.png", + "avatar_static": "https://files.mastodon.social/accounts/avatars/000/013/179/original/b4ceb19c9c54ec7e.png", + "header": "https://files.mastodon.social/accounts/headers/000/013/179/original/1375be116fbe0f1d.png", + "header_static": "https://files.mastodon.social/accounts/headers/000/013/179/original/1375be116fbe0f1d.png", + "followers_count": 837871, "following_count": 4, "statuses_count": 289, "last_status_at": + "2025-02-14", "hide_collections": false, "noindex": false, "emojis": [], "roles": + [], "fields": [{"name": "Homepage", "value": "https://joinmastodon.org", + "verified_at": "2018-10-31T04:11:00.076+00:00"}, {"name": "Patreon", "value": + "https://patreon.com/mastodon", + "verified_at": null}, {"name": "GitHub", "value": "https://github.com/mastodon", + "verified_at": "2023-07-21T13:27:45.996+00:00"}]}, "rules": [{"id": "1", "text": + "Sexually explicit or violent media must be marked as sensitive or with a + content warning", "hint": "This includes content that is particularly provocative + even if it may not show specific body parts, as well as dead bodies, bloody + injuries, and other gore. Particularly obscene content may be prohibited entirely. + Profile pictures and header images may not contain sexually explicit or violent + media."}, {"id": "2", "text": "No racism, sexism, homophobia, transphobia, + ableism, xenophobia, or casteism.", "hint": "Transphobic behavior such as + intentional misgendering and deadnaming is strictly prohibited. Promotion + of \"conversion therapy\" is strictly prohibited. Criticism of governments + and religions is permissible unless being used as a proxy for discrimination."}, + {"id": "3", "text": "No incitement of violence or promotion of violent ideologies", + "hint": "Calling for people or groups to be assassinated, murdered, or attacked + physically is strictly prohibited. Support for violent groups or events is + prohibited."}, {"id": "4", "text": "No harassment, block evasion, dogpiling, + or doxxing of others", "hint": "Repeat attempts to communicate with users + who have blocked you or creation of accounts solely to harass or insult individuals + is strictly prohibited. Coordinated activity to attack other users is prohibited. + Posting of private personal information about others is prohibited."}, {"id": + "7", "text": "Do not share information widely-known to be false and misleading", + "hint": "False and misleading information and links from low-quality sources + may not be posted, especially if they are likely to mislead or confuse others + or endanger their safety."}, {"id": "1008", "text": "Content created by others + must be attributed, and use of generative AI must be disclosed", "hint": "Content + created by others must clearly provide a reference to the author, creator, + or source. For adult content, this should include performers. Accounts may + not solely post AI-generated content."}]}' + headers: + Accept-Ranges: + - bytes + Age: + - '221' + Connection: + - keep-alive + Date: + - Fri, 14 Feb 2025 22:39:47 GMT + Strict-Transport-Security: + - max-age=31557600 + Vary: + - Accept, Origin, Accept-Encoding + X-Cache: + - MISS, HIT, HIT + X-Cache-Hits: + - 0, 5, 1 + X-Served-By: + - cache-fra-eddf8230164-FRA, cache-fra-eddf8230152-FRA, cache-hel1410031-HEL + X-Timer: + - S1739572787.196270,VS0,VE1 + alt-svc: + - h3=":443";ma=86400,h3-29=":443";ma=86400,h3-27=":443";ma=86400 + cache-control: + - max-age=300, public, stale-while-revalidate=30, stale-if-error=86400 + content-length: + - '5442' + content-security-policy: + - default-src 'none'; frame-ancestors 'none'; form-action 'none' + content-type: + - application/json; charset=utf-8 + etag: + - W/"bc38a058993fdbe29400795727e9d33c" + referrer-policy: + - same-origin + via: + - 1.1 varnish, 1.1 varnish, 1.1 varnish + x-content-type-options: + - nosniff + x-frame-options: + - DENY + x-ratelimit-limit: + - '300' + x-ratelimit-remaining: + - '270' + x-ratelimit-reset: + - '2025-02-14T22:40:00.053698Z' + x-request-id: + - 8280556bb02fca4d6ed4a6da22529247 + x-runtime: + - '0.032541' + x-xss-protection: + - '0' + status: + code: 200 + message: OK - request: body: null headers: @@ -56,8 +193,8 @@ interactions: "avatar_static": "https://files.mastodon.social/accounts/avatars/000/013/179/original/b4ceb19c9c54ec7e.png", "header": "https://files.mastodon.social/accounts/headers/000/013/179/original/1375be116fbe0f1d.png", "header_static": "https://files.mastodon.social/accounts/headers/000/013/179/original/1375be116fbe0f1d.png", - "followers_count": 837809, "following_count": 4, "statuses_count": 288, "last_status_at": - "2025-01-27", "hide_collections": false, "noindex": false, "emojis": [], "roles": + "followers_count": 837872, "following_count": 4, "statuses_count": 289, "last_status_at": + "2025-02-14", "hide_collections": false, "noindex": false, "emojis": [], "roles": [], "fields": [{"name": "Homepage", "value": "https://joinmastodon.org", @@ -103,7 +240,7 @@ interactions: Connection: - keep-alive Date: - - Fri, 14 Feb 2025 15:38:21 GMT + - Fri, 14 Feb 2025 22:39:47 GMT Strict-Transport-Security: - max-age=31557600 Vary: @@ -113,9 +250,9 @@ interactions: X-Cache-Hits: - 0, 0, 1 X-Served-By: - - cache-fra-etou8220030-FRA, cache-fra-etou8220030-FRA, cache-hel1410031-HEL + - cache-fra-etou8220040-FRA, cache-fra-etou8220030-FRA, cache-hel1410031-HEL X-Timer: - - S1739547502.566874,VS0,VE1 + - S1739572787.232396,VS0,VE1 alt-svc: - h3=":443";ma=86400,h3-29=":443";ma=86400,h3-27=":443";ma=86400 cache-control: @@ -127,7 +264,7 @@ interactions: content-type: - application/json; charset=utf-8 etag: - - W/"551fae2c400427901fea0abc350f319e" + - W/"baea7f6f665258ec0ad4fd954447a184" referrer-policy: - same-origin via: @@ -139,13 +276,13 @@ interactions: x-ratelimit-limit: - '300' x-ratelimit-remaining: - - '283' + - '298' x-ratelimit-reset: - - '2025-02-14T15:40:00.797193Z' + - '2025-02-14T22:40:00.379655Z' x-request-id: - - d0c06378678677c73ba1d406ec7a294b + - e488feea20c504741068107e2a536dd1 x-runtime: - - '0.024948' + - '0.032660' x-xss-protection: - '0' status: diff --git a/tests/cassettes_entity_tests/test_entity_instanceusageusers.yaml b/tests/cassettes_entity_tests/test_entity_instanceusageusers.yaml index 49a172b..627267c 100644 --- a/tests/cassettes_entity_tests/test_entity_instanceusageusers.yaml +++ b/tests/cassettes_entity_tests/test_entity_instanceusageusers.yaml @@ -1,4 +1,141 @@ interactions: +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Authorization: + - DUMMY + Connection: + - keep-alive + User-Agent: + - mastodonpy + method: GET + uri: https://mastodon.social/api/v1/instance/ + response: + body: + string: '{"uri": "mastodon.social", "title": "Mastodon", "short_description": + "The original server operated by the Mastodon gGmbH non-profit", "description": + "", "email": "staff@mastodon.social", "version": "4.4.0-nightly.2025-02-07", + "urls": {"streaming_api": "wss://streaming.mastodon.social"}, "stats": {"user_count": + 2522485, "status_count": 120163210, "domain_count": 81770}, "thumbnail": "https://files.mastodon.social/site_uploads/files/000/000/001/@1x/57c12f441d083cde.png", + "languages": ["en"], "registrations": true, "approval_required": false, "invites_enabled": + true, "configuration": {"accounts": {"max_featured_tags": 10}, "statuses": + {"max_characters": 500, "max_media_attachments": 4, "characters_reserved_per_url": + 23}, "media_attachments": {"supported_mime_types": ["image/jpeg", "image/png", + "image/gif", "image/heic", "image/heif", "image/webp", "image/avif", "video/webm", + "video/mp4", "video/quicktime", "video/ogg", "audio/wave", "audio/wav", "audio/x-wav", + "audio/x-pn-wave", "audio/vnd.wave", "audio/ogg", "audio/vorbis", "audio/mpeg", + "audio/mp3", "audio/webm", "audio/flac", "audio/aac", "audio/m4a", "audio/x-m4a", + "audio/mp4", "audio/3gpp", "video/x-ms-asf"], "image_size_limit": 16777216, + "image_matrix_limit": 33177600, "video_size_limit": 103809024, "video_frame_rate_limit": + 120, "video_matrix_limit": 8294400}, "polls": {"max_options": 4, "max_characters_per_option": + 50, "min_expiration": 300, "max_expiration": 2629746}}, "contact_account": + {"id": "13179", "username": "Mastodon", "acct": "Mastodon", "display_name": + "Mastodon", "locked": false, "bot": false, "discoverable": true, "indexable": + false, "group": false, "created_at": "2016-11-23T00:00:00.000Z", "note": "

Free, + open-source decentralized social media platform.

", "url": "https://mastodon.social/@Mastodon", + "uri": "https://mastodon.social/users/Mastodon", "avatar": "https://files.mastodon.social/accounts/avatars/000/013/179/original/b4ceb19c9c54ec7e.png", + "avatar_static": "https://files.mastodon.social/accounts/avatars/000/013/179/original/b4ceb19c9c54ec7e.png", + "header": "https://files.mastodon.social/accounts/headers/000/013/179/original/1375be116fbe0f1d.png", + "header_static": "https://files.mastodon.social/accounts/headers/000/013/179/original/1375be116fbe0f1d.png", + "followers_count": 837871, "following_count": 4, "statuses_count": 289, "last_status_at": + "2025-02-14", "hide_collections": false, "noindex": false, "emojis": [], "roles": + [], "fields": [{"name": "Homepage", "value": "https://joinmastodon.org", + "verified_at": "2018-10-31T04:11:00.076+00:00"}, {"name": "Patreon", "value": + "https://patreon.com/mastodon", + "verified_at": null}, {"name": "GitHub", "value": "https://github.com/mastodon", + "verified_at": "2023-07-21T13:27:45.996+00:00"}]}, "rules": [{"id": "1", "text": + "Sexually explicit or violent media must be marked as sensitive or with a + content warning", "hint": "This includes content that is particularly provocative + even if it may not show specific body parts, as well as dead bodies, bloody + injuries, and other gore. Particularly obscene content may be prohibited entirely. + Profile pictures and header images may not contain sexually explicit or violent + media."}, {"id": "2", "text": "No racism, sexism, homophobia, transphobia, + ableism, xenophobia, or casteism.", "hint": "Transphobic behavior such as + intentional misgendering and deadnaming is strictly prohibited. Promotion + of \"conversion therapy\" is strictly prohibited. Criticism of governments + and religions is permissible unless being used as a proxy for discrimination."}, + {"id": "3", "text": "No incitement of violence or promotion of violent ideologies", + "hint": "Calling for people or groups to be assassinated, murdered, or attacked + physically is strictly prohibited. Support for violent groups or events is + prohibited."}, {"id": "4", "text": "No harassment, block evasion, dogpiling, + or doxxing of others", "hint": "Repeat attempts to communicate with users + who have blocked you or creation of accounts solely to harass or insult individuals + is strictly prohibited. Coordinated activity to attack other users is prohibited. + Posting of private personal information about others is prohibited."}, {"id": + "7", "text": "Do not share information widely-known to be false and misleading", + "hint": "False and misleading information and links from low-quality sources + may not be posted, especially if they are likely to mislead or confuse others + or endanger their safety."}, {"id": "1008", "text": "Content created by others + must be attributed, and use of generative AI must be disclosed", "hint": "Content + created by others must clearly provide a reference to the author, creator, + or source. For adult content, this should include performers. Accounts may + not solely post AI-generated content."}]}' + headers: + Accept-Ranges: + - bytes + Age: + - '221' + Connection: + - keep-alive + Date: + - Fri, 14 Feb 2025 22:39:47 GMT + Strict-Transport-Security: + - max-age=31557600 + Vary: + - Accept, Origin, Accept-Encoding + X-Cache: + - MISS, HIT, HIT + X-Cache-Hits: + - 0, 5, 3 + X-Served-By: + - cache-fra-eddf8230164-FRA, cache-fra-eddf8230152-FRA, cache-hel1410030-HEL + X-Timer: + - S1739572787.316258,VS0,VE0 + alt-svc: + - h3=":443";ma=86400,h3-29=":443";ma=86400,h3-27=":443";ma=86400 + cache-control: + - max-age=300, public, stale-while-revalidate=30, stale-if-error=86400 + content-length: + - '5442' + content-security-policy: + - default-src 'none'; frame-ancestors 'none'; form-action 'none' + content-type: + - application/json; charset=utf-8 + etag: + - W/"bc38a058993fdbe29400795727e9d33c" + referrer-policy: + - same-origin + via: + - 1.1 varnish, 1.1 varnish, 1.1 varnish + x-content-type-options: + - nosniff + x-frame-options: + - DENY + x-ratelimit-limit: + - '300' + x-ratelimit-remaining: + - '270' + x-ratelimit-reset: + - '2025-02-14T22:40:00.053698Z' + x-request-id: + - 8280556bb02fca4d6ed4a6da22529247 + x-runtime: + - '0.032541' + x-xss-protection: + - '0' + status: + code: 200 + message: OK - request: body: null headers: @@ -56,8 +193,8 @@ interactions: "avatar_static": "https://files.mastodon.social/accounts/avatars/000/013/179/original/b4ceb19c9c54ec7e.png", "header": "https://files.mastodon.social/accounts/headers/000/013/179/original/1375be116fbe0f1d.png", "header_static": "https://files.mastodon.social/accounts/headers/000/013/179/original/1375be116fbe0f1d.png", - "followers_count": 837809, "following_count": 4, "statuses_count": 288, "last_status_at": - "2025-01-27", "hide_collections": false, "noindex": false, "emojis": [], "roles": + "followers_count": 837872, "following_count": 4, "statuses_count": 289, "last_status_at": + "2025-02-14", "hide_collections": false, "noindex": false, "emojis": [], "roles": [], "fields": [{"name": "Homepage", "value": "https://joinmastodon.org", @@ -103,7 +240,7 @@ interactions: Connection: - keep-alive Date: - - Fri, 14 Feb 2025 15:38:21 GMT + - Fri, 14 Feb 2025 22:39:47 GMT Strict-Transport-Security: - max-age=31557600 Vary: @@ -111,11 +248,11 @@ interactions: X-Cache: - MISS, MISS, HIT X-Cache-Hits: - - 0, 0, 1 + - 0, 0, 2 X-Served-By: - - cache-fra-etou8220030-FRA, cache-fra-etou8220030-FRA, cache-hel1410027-HEL + - cache-fra-etou8220040-FRA, cache-fra-etou8220030-FRA, cache-hel1410030-HEL X-Timer: - - S1739547502.649984,VS0,VE1 + - S1739572787.348305,VS0,VE0 alt-svc: - h3=":443";ma=86400,h3-29=":443";ma=86400,h3-27=":443";ma=86400 cache-control: @@ -127,7 +264,7 @@ interactions: content-type: - application/json; charset=utf-8 etag: - - W/"551fae2c400427901fea0abc350f319e" + - W/"baea7f6f665258ec0ad4fd954447a184" referrer-policy: - same-origin via: @@ -139,13 +276,13 @@ interactions: x-ratelimit-limit: - '300' x-ratelimit-remaining: - - '283' + - '298' x-ratelimit-reset: - - '2025-02-14T15:40:00.797193Z' + - '2025-02-14T22:40:00.379655Z' x-request-id: - - d0c06378678677c73ba1d406ec7a294b + - e488feea20c504741068107e2a536dd1 x-runtime: - - '0.024948' + - '0.032660' x-xss-protection: - '0' status: diff --git a/tests/cassettes_entity_tests/test_entity_instancev2.yaml b/tests/cassettes_entity_tests/test_entity_instancev2.yaml index 6b83f46..caa06e7 100644 --- a/tests/cassettes_entity_tests/test_entity_instancev2.yaml +++ b/tests/cassettes_entity_tests/test_entity_instancev2.yaml @@ -56,8 +56,8 @@ interactions: "avatar_static": "https://files.mastodon.social/accounts/avatars/000/013/179/original/b4ceb19c9c54ec7e.png", "header": "https://files.mastodon.social/accounts/headers/000/013/179/original/1375be116fbe0f1d.png", "header_static": "https://files.mastodon.social/accounts/headers/000/013/179/original/1375be116fbe0f1d.png", - "followers_count": 837809, "following_count": 4, "statuses_count": 288, "last_status_at": - "2025-01-27", "hide_collections": false, "noindex": false, "emojis": [], "roles": + "followers_count": 837872, "following_count": 4, "statuses_count": 289, "last_status_at": + "2025-02-14", "hide_collections": false, "noindex": false, "emojis": [], "roles": [], "fields": [{"name": "Homepage", "value": "https://joinmastodon.org", @@ -103,7 +103,7 @@ interactions: Connection: - keep-alive Date: - - Fri, 14 Feb 2025 15:38:20 GMT + - Fri, 14 Feb 2025 22:39:46 GMT Strict-Transport-Security: - max-age=31557600 Vary: @@ -113,9 +113,9 @@ interactions: X-Cache-Hits: - 0, 0, 0 X-Served-By: - - cache-fra-etou8220030-FRA, cache-fra-etou8220030-FRA, cache-hel1410023-HEL + - cache-fra-etou8220040-FRA, cache-fra-etou8220030-FRA, cache-hel1410026-HEL X-Timer: - - S1739547501.702385,VS0,VE119 + - S1739572786.318154,VS0,VE84 alt-svc: - h3=":443";ma=86400,h3-29=":443";ma=86400,h3-27=":443";ma=86400 cache-control: @@ -127,7 +127,7 @@ interactions: content-type: - application/json; charset=utf-8 etag: - - W/"551fae2c400427901fea0abc350f319e" + - W/"baea7f6f665258ec0ad4fd954447a184" referrer-policy: - same-origin via: @@ -139,13 +139,13 @@ interactions: x-ratelimit-limit: - '300' x-ratelimit-remaining: - - '283' + - '298' x-ratelimit-reset: - - '2025-02-14T15:40:00.797193Z' + - '2025-02-14T22:40:00.379655Z' x-request-id: - - d0c06378678677c73ba1d406ec7a294b + - e488feea20c504741068107e2a536dd1 x-runtime: - - '0.024948' + - '0.032660' x-xss-protection: - '0' status: diff --git a/tests/cassettes_entity_tests/test_entity_instancevapidkey.yaml b/tests/cassettes_entity_tests/test_entity_instancevapidkey.yaml index 4c7d1dd..207bd3c 100644 --- a/tests/cassettes_entity_tests/test_entity_instancevapidkey.yaml +++ b/tests/cassettes_entity_tests/test_entity_instancevapidkey.yaml @@ -56,8 +56,8 @@ interactions: "avatar_static": "https://files.mastodon.social/accounts/avatars/000/013/179/original/b4ceb19c9c54ec7e.png", "header": "https://files.mastodon.social/accounts/headers/000/013/179/original/1375be116fbe0f1d.png", "header_static": "https://files.mastodon.social/accounts/headers/000/013/179/original/1375be116fbe0f1d.png", - "followers_count": 837809, "following_count": 4, "statuses_count": 288, "last_status_at": - "2025-01-27", "hide_collections": false, "noindex": false, "emojis": [], "roles": + "followers_count": 837872, "following_count": 4, "statuses_count": 289, "last_status_at": + "2025-02-14", "hide_collections": false, "noindex": false, "emojis": [], "roles": [], "fields": [{"name": "Homepage", "value": "https://joinmastodon.org", @@ -103,7 +103,7 @@ interactions: Connection: - keep-alive Date: - - Fri, 14 Feb 2025 15:38:21 GMT + - Fri, 14 Feb 2025 22:39:46 GMT Strict-Transport-Security: - max-age=31557600 Vary: @@ -113,9 +113,9 @@ interactions: X-Cache-Hits: - 0, 0, 1 X-Served-By: - - cache-fra-etou8220030-FRA, cache-fra-etou8220030-FRA, cache-hel1410020-HEL + - cache-fra-etou8220040-FRA, cache-fra-etou8220030-FRA, cache-hel1410033-HEL X-Timer: - - S1739547501.101997,VS0,VE1 + - S1739572787.728518,VS0,VE1 alt-svc: - h3=":443";ma=86400,h3-29=":443";ma=86400,h3-27=":443";ma=86400 cache-control: @@ -127,7 +127,7 @@ interactions: content-type: - application/json; charset=utf-8 etag: - - W/"551fae2c400427901fea0abc350f319e" + - W/"baea7f6f665258ec0ad4fd954447a184" referrer-policy: - same-origin via: @@ -139,13 +139,13 @@ interactions: x-ratelimit-limit: - '300' x-ratelimit-remaining: - - '283' + - '298' x-ratelimit-reset: - - '2025-02-14T15:40:00.797193Z' + - '2025-02-14T22:40:00.379655Z' x-request-id: - - d0c06378678677c73ba1d406ec7a294b + - e488feea20c504741068107e2a536dd1 x-runtime: - - '0.024948' + - '0.032660' x-xss-protection: - '0' status: diff --git a/tests/cassettes_entity_tests/test_entity_rule.yaml b/tests/cassettes_entity_tests/test_entity_rule.yaml index 4a7cd13..e4d3f78 100644 --- a/tests/cassettes_entity_tests/test_entity_rule.yaml +++ b/tests/cassettes_entity_tests/test_entity_rule.yaml @@ -1,4 +1,141 @@ interactions: +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Authorization: + - DUMMY + Connection: + - keep-alive + User-Agent: + - mastodonpy + method: GET + uri: https://mastodon.social/api/v1/instance/ + response: + body: + string: '{"uri": "mastodon.social", "title": "Mastodon", "short_description": + "The original server operated by the Mastodon gGmbH non-profit", "description": + "", "email": "staff@mastodon.social", "version": "4.4.0-nightly.2025-02-07", + "urls": {"streaming_api": "wss://streaming.mastodon.social"}, "stats": {"user_count": + 2522485, "status_count": 120163210, "domain_count": 81770}, "thumbnail": "https://files.mastodon.social/site_uploads/files/000/000/001/@1x/57c12f441d083cde.png", + "languages": ["en"], "registrations": true, "approval_required": false, "invites_enabled": + true, "configuration": {"accounts": {"max_featured_tags": 10}, "statuses": + {"max_characters": 500, "max_media_attachments": 4, "characters_reserved_per_url": + 23}, "media_attachments": {"supported_mime_types": ["image/jpeg", "image/png", + "image/gif", "image/heic", "image/heif", "image/webp", "image/avif", "video/webm", + "video/mp4", "video/quicktime", "video/ogg", "audio/wave", "audio/wav", "audio/x-wav", + "audio/x-pn-wave", "audio/vnd.wave", "audio/ogg", "audio/vorbis", "audio/mpeg", + "audio/mp3", "audio/webm", "audio/flac", "audio/aac", "audio/m4a", "audio/x-m4a", + "audio/mp4", "audio/3gpp", "video/x-ms-asf"], "image_size_limit": 16777216, + "image_matrix_limit": 33177600, "video_size_limit": 103809024, "video_frame_rate_limit": + 120, "video_matrix_limit": 8294400}, "polls": {"max_options": 4, "max_characters_per_option": + 50, "min_expiration": 300, "max_expiration": 2629746}}, "contact_account": + {"id": "13179", "username": "Mastodon", "acct": "Mastodon", "display_name": + "Mastodon", "locked": false, "bot": false, "discoverable": true, "indexable": + false, "group": false, "created_at": "2016-11-23T00:00:00.000Z", "note": "

Free, + open-source decentralized social media platform.

", "url": "https://mastodon.social/@Mastodon", + "uri": "https://mastodon.social/users/Mastodon", "avatar": "https://files.mastodon.social/accounts/avatars/000/013/179/original/b4ceb19c9c54ec7e.png", + "avatar_static": "https://files.mastodon.social/accounts/avatars/000/013/179/original/b4ceb19c9c54ec7e.png", + "header": "https://files.mastodon.social/accounts/headers/000/013/179/original/1375be116fbe0f1d.png", + "header_static": "https://files.mastodon.social/accounts/headers/000/013/179/original/1375be116fbe0f1d.png", + "followers_count": 837871, "following_count": 4, "statuses_count": 289, "last_status_at": + "2025-02-14", "hide_collections": false, "noindex": false, "emojis": [], "roles": + [], "fields": [{"name": "Homepage", "value": "https://joinmastodon.org", + "verified_at": "2018-10-31T04:11:00.076+00:00"}, {"name": "Patreon", "value": + "https://patreon.com/mastodon", + "verified_at": null}, {"name": "GitHub", "value": "https://github.com/mastodon", + "verified_at": "2023-07-21T13:27:45.996+00:00"}]}, "rules": [{"id": "1", "text": + "Sexually explicit or violent media must be marked as sensitive or with a + content warning", "hint": "This includes content that is particularly provocative + even if it may not show specific body parts, as well as dead bodies, bloody + injuries, and other gore. Particularly obscene content may be prohibited entirely. + Profile pictures and header images may not contain sexually explicit or violent + media."}, {"id": "2", "text": "No racism, sexism, homophobia, transphobia, + ableism, xenophobia, or casteism.", "hint": "Transphobic behavior such as + intentional misgendering and deadnaming is strictly prohibited. Promotion + of \"conversion therapy\" is strictly prohibited. Criticism of governments + and religions is permissible unless being used as a proxy for discrimination."}, + {"id": "3", "text": "No incitement of violence or promotion of violent ideologies", + "hint": "Calling for people or groups to be assassinated, murdered, or attacked + physically is strictly prohibited. Support for violent groups or events is + prohibited."}, {"id": "4", "text": "No harassment, block evasion, dogpiling, + or doxxing of others", "hint": "Repeat attempts to communicate with users + who have blocked you or creation of accounts solely to harass or insult individuals + is strictly prohibited. Coordinated activity to attack other users is prohibited. + Posting of private personal information about others is prohibited."}, {"id": + "7", "text": "Do not share information widely-known to be false and misleading", + "hint": "False and misleading information and links from low-quality sources + may not be posted, especially if they are likely to mislead or confuse others + or endanger their safety."}, {"id": "1008", "text": "Content created by others + must be attributed, and use of generative AI must be disclosed", "hint": "Content + created by others must clearly provide a reference to the author, creator, + or source. For adult content, this should include performers. Accounts may + not solely post AI-generated content."}]}' + headers: + Accept-Ranges: + - bytes + Age: + - '247' + Connection: + - keep-alive + Date: + - Fri, 14 Feb 2025 22:40:12 GMT + Strict-Transport-Security: + - max-age=31557600 + Vary: + - Accept, Origin, Accept-Encoding + X-Cache: + - MISS, HIT, HIT + X-Cache-Hits: + - 0, 5, 1 + X-Served-By: + - cache-fra-eddf8230164-FRA, cache-fra-eddf8230152-FRA, cache-hel1410028-HEL + X-Timer: + - S1739572813.983530,VS0,VE1 + alt-svc: + - h3=":443";ma=86400,h3-29=":443";ma=86400,h3-27=":443";ma=86400 + cache-control: + - max-age=300, public, stale-while-revalidate=30, stale-if-error=86400 + content-length: + - '5442' + content-security-policy: + - default-src 'none'; frame-ancestors 'none'; form-action 'none' + content-type: + - application/json; charset=utf-8 + etag: + - W/"bc38a058993fdbe29400795727e9d33c" + referrer-policy: + - same-origin + via: + - 1.1 varnish, 1.1 varnish, 1.1 varnish + x-content-type-options: + - nosniff + x-frame-options: + - DENY + x-ratelimit-limit: + - '300' + x-ratelimit-remaining: + - '270' + x-ratelimit-reset: + - '2025-02-14T22:40:00.053698Z' + x-request-id: + - 8280556bb02fca4d6ed4a6da22529247 + x-runtime: + - '0.032541' + x-xss-protection: + - '0' + status: + code: 200 + message: OK - request: body: null headers: @@ -56,8 +193,8 @@ interactions: "avatar_static": "https://files.mastodon.social/accounts/avatars/000/013/179/original/b4ceb19c9c54ec7e.png", "header": "https://files.mastodon.social/accounts/headers/000/013/179/original/1375be116fbe0f1d.png", "header_static": "https://files.mastodon.social/accounts/headers/000/013/179/original/1375be116fbe0f1d.png", - "followers_count": 837809, "following_count": 4, "statuses_count": 288, "last_status_at": - "2025-01-27", "hide_collections": false, "noindex": false, "emojis": [], "roles": + "followers_count": 837872, "following_count": 4, "statuses_count": 289, "last_status_at": + "2025-02-14", "hide_collections": false, "noindex": false, "emojis": [], "roles": [], "fields": [{"name": "Homepage", "value": "https://joinmastodon.org", @@ -99,11 +236,11 @@ interactions: Accept-Ranges: - bytes Age: - - '0' + - '26' Connection: - keep-alive Date: - - Fri, 14 Feb 2025 15:38:21 GMT + - Fri, 14 Feb 2025 22:40:13 GMT Strict-Transport-Security: - max-age=31557600 Vary: @@ -111,11 +248,11 @@ interactions: X-Cache: - MISS, MISS, HIT X-Cache-Hits: - - 0, 0, 2 + - 0, 0, 3 X-Served-By: - - cache-fra-etou8220030-FRA, cache-fra-etou8220030-FRA, cache-hel1410029-HEL + - cache-fra-etou8220040-FRA, cache-fra-etou8220030-FRA, cache-hel1410028-HEL X-Timer: - - S1739547502.730530,VS0,VE0 + - S1739572813.016271,VS0,VE0 alt-svc: - h3=":443";ma=86400,h3-29=":443";ma=86400,h3-27=":443";ma=86400 cache-control: @@ -127,7 +264,7 @@ interactions: content-type: - application/json; charset=utf-8 etag: - - W/"551fae2c400427901fea0abc350f319e" + - W/"baea7f6f665258ec0ad4fd954447a184" referrer-policy: - same-origin via: @@ -139,13 +276,13 @@ interactions: x-ratelimit-limit: - '300' x-ratelimit-remaining: - - '283' + - '298' x-ratelimit-reset: - - '2025-02-14T15:40:00.797193Z' + - '2025-02-14T22:40:00.379655Z' x-request-id: - - d0c06378678677c73ba1d406ec7a294b + - e488feea20c504741068107e2a536dd1 x-runtime: - - '0.024948' + - '0.032660' x-xss-protection: - '0' status: diff --git a/tests/cassettes_entity_tests/test_entity_suggestion.yaml b/tests/cassettes_entity_tests/test_entity_suggestion.yaml new file mode 100644 index 0000000..51f6d3d --- /dev/null +++ b/tests/cassettes_entity_tests/test_entity_suggestion.yaml @@ -0,0 +1,1119 @@ +interactions: +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Authorization: + - DUMMY + Connection: + - keep-alive + User-Agent: + - mastodonpy + method: GET + uri: https://mastodon.social/api/v1/instance/ + response: + body: + string: '{"uri": "mastodon.social", "title": "Mastodon", "short_description": + "The original server operated by the Mastodon gGmbH non-profit", "description": + "", "email": "staff@mastodon.social", "version": "4.4.0-nightly.2025-02-07", + "urls": {"streaming_api": "wss://streaming.mastodon.social"}, "stats": {"user_count": + 2522485, "status_count": 120163210, "domain_count": 81770}, "thumbnail": "https://files.mastodon.social/site_uploads/files/000/000/001/@1x/57c12f441d083cde.png", + "languages": ["en"], "registrations": true, "approval_required": false, "invites_enabled": + true, "configuration": {"accounts": {"max_featured_tags": 10}, "statuses": + {"max_characters": 500, "max_media_attachments": 4, "characters_reserved_per_url": + 23}, "media_attachments": {"supported_mime_types": ["image/jpeg", "image/png", + "image/gif", "image/heic", "image/heif", "image/webp", "image/avif", "video/webm", + "video/mp4", "video/quicktime", "video/ogg", "audio/wave", "audio/wav", "audio/x-wav", + "audio/x-pn-wave", "audio/vnd.wave", "audio/ogg", "audio/vorbis", "audio/mpeg", + "audio/mp3", "audio/webm", "audio/flac", "audio/aac", "audio/m4a", "audio/x-m4a", + "audio/mp4", "audio/3gpp", "video/x-ms-asf"], "image_size_limit": 16777216, + "image_matrix_limit": 33177600, "video_size_limit": 103809024, "video_frame_rate_limit": + 120, "video_matrix_limit": 8294400}, "polls": {"max_options": 4, "max_characters_per_option": + 50, "min_expiration": 300, "max_expiration": 2629746}}, "contact_account": + {"id": "13179", "username": "Mastodon", "acct": "Mastodon", "display_name": + "Mastodon", "locked": false, "bot": false, "discoverable": true, "indexable": + false, "group": false, "created_at": "2016-11-23T00:00:00.000Z", "note": "

Free, + open-source decentralized social media platform.

", "url": "https://mastodon.social/@Mastodon", + "uri": "https://mastodon.social/users/Mastodon", "avatar": "https://files.mastodon.social/accounts/avatars/000/013/179/original/b4ceb19c9c54ec7e.png", + "avatar_static": "https://files.mastodon.social/accounts/avatars/000/013/179/original/b4ceb19c9c54ec7e.png", + "header": "https://files.mastodon.social/accounts/headers/000/013/179/original/1375be116fbe0f1d.png", + "header_static": "https://files.mastodon.social/accounts/headers/000/013/179/original/1375be116fbe0f1d.png", + "followers_count": 837871, "following_count": 4, "statuses_count": 289, "last_status_at": + "2025-02-14", "hide_collections": false, "noindex": false, "emojis": [], "roles": + [], "fields": [{"name": "Homepage", "value": "https://joinmastodon.org", + "verified_at": "2018-10-31T04:11:00.076+00:00"}, {"name": "Patreon", "value": + "https://patreon.com/mastodon", + "verified_at": null}, {"name": "GitHub", "value": "https://github.com/mastodon", + "verified_at": "2023-07-21T13:27:45.996+00:00"}]}, "rules": [{"id": "1", "text": + "Sexually explicit or violent media must be marked as sensitive or with a + content warning", "hint": "This includes content that is particularly provocative + even if it may not show specific body parts, as well as dead bodies, bloody + injuries, and other gore. Particularly obscene content may be prohibited entirely. + Profile pictures and header images may not contain sexually explicit or violent + media."}, {"id": "2", "text": "No racism, sexism, homophobia, transphobia, + ableism, xenophobia, or casteism.", "hint": "Transphobic behavior such as + intentional misgendering and deadnaming is strictly prohibited. Promotion + of \"conversion therapy\" is strictly prohibited. Criticism of governments + and religions is permissible unless being used as a proxy for discrimination."}, + {"id": "3", "text": "No incitement of violence or promotion of violent ideologies", + "hint": "Calling for people or groups to be assassinated, murdered, or attacked + physically is strictly prohibited. Support for violent groups or events is + prohibited."}, {"id": "4", "text": "No harassment, block evasion, dogpiling, + or doxxing of others", "hint": "Repeat attempts to communicate with users + who have blocked you or creation of accounts solely to harass or insult individuals + is strictly prohibited. Coordinated activity to attack other users is prohibited. + Posting of private personal information about others is prohibited."}, {"id": + "7", "text": "Do not share information widely-known to be false and misleading", + "hint": "False and misleading information and links from low-quality sources + may not be posted, especially if they are likely to mislead or confuse others + or endanger their safety."}, {"id": "1008", "text": "Content created by others + must be attributed, and use of generative AI must be disclosed", "hint": "Content + created by others must clearly provide a reference to the author, creator, + or source. For adult content, this should include performers. Accounts may + not solely post AI-generated content."}]}' + headers: + Accept-Ranges: + - bytes + Age: + - '159' + Connection: + - keep-alive + Date: + - Fri, 14 Feb 2025 22:38:45 GMT + Strict-Transport-Security: + - max-age=31557600 + Vary: + - Accept, Origin, Accept-Encoding + X-Cache: + - MISS, HIT, HIT + X-Cache-Hits: + - 0, 5, 1 + X-Served-By: + - cache-fra-eddf8230164-FRA, cache-fra-eddf8230152-FRA, cache-hel1410021-HEL + X-Timer: + - S1739572725.465765,VS0,VE1 + alt-svc: + - h3=":443";ma=86400,h3-29=":443";ma=86400,h3-27=":443";ma=86400 + cache-control: + - max-age=300, public, stale-while-revalidate=30, stale-if-error=86400 + content-length: + - '5442' + content-security-policy: + - default-src 'none'; frame-ancestors 'none'; form-action 'none' + content-type: + - application/json; charset=utf-8 + etag: + - W/"bc38a058993fdbe29400795727e9d33c" + referrer-policy: + - same-origin + via: + - 1.1 varnish, 1.1 varnish, 1.1 varnish + x-content-type-options: + - nosniff + x-frame-options: + - DENY + x-ratelimit-limit: + - '300' + x-ratelimit-remaining: + - '270' + x-ratelimit-reset: + - '2025-02-14T22:40:00.053698Z' + x-request-id: + - 8280556bb02fca4d6ed4a6da22529247 + x-runtime: + - '0.032541' + x-xss-protection: + - '0' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Authorization: + - DUMMY + Connection: + - keep-alive + User-Agent: + - mastodonpy + method: GET + uri: https://mastodon.social/api/v2/suggestions + response: + body: + string: '[{"source": "past_interactions", "sources": ["friends_of_friends"], + "account": {"id": "23989", "username": "lazyreader", "acct": "lazyreader@icosahedron.website", + "display_name": "DMA", "locked": false, "bot": false, "discoverable": true, + "indexable": false, "group": false, "created_at": "2017-02-13T00:00:00.000Z", + "note": "

Developer in JC, NJ. Helps make paperswelove.org happen.

", + "url": "https://icosahedron.website/@lazyreader", "uri": "https://icosahedron.website/users/lazyreader", + "avatar": "https://files.mastodon.social/cache/accounts/avatars/000/023/989/original/80b3c547ae877fd8.jpg", + "avatar_static": "https://files.mastodon.social/cache/accounts/avatars/000/023/989/original/80b3c547ae877fd8.jpg", + "header": "https://files.mastodon.social/cache/accounts/headers/000/023/989/original/4401de6754371791.jpeg", + "header_static": "https://files.mastodon.social/cache/accounts/headers/000/023/989/original/4401de6754371791.jpeg", + "followers_count": 97, "following_count": 114, "statuses_count": 646, "last_status_at": + "2025-01-28", "hide_collections": false, "emojis": [], "fields": [{"name": + "homepage", "value": "https://yetaga.in/", "verified_at": + "2025-01-28T17:38:16.435+00:00"}, {"name": "twitter", "value": "https://twitter.com/alazyreader", + "verified_at": null}]}}, {"source": "staff", "sources": ["featured", "most_interactions", + "most_followed"], "account": {"id": "110266162634306901", "username": "arstechnica", + "acct": "arstechnica", "display_name": "Ars Technica", "locked": false, "bot": + false, "discoverable": true, "indexable": false, "group": false, "created_at": + "2023-04-26T00:00:00.000Z", "note": "

Original news, reviews, analysis of + tech trends, and expert advice on the most fundamental aspects of tech.

Official + Ars Technica account. \ud83d\udfe0

", "url": "https://mastodon.social/@arstechnica", + "uri": "https://mastodon.social/users/arstechnica", "avatar": "https://files.mastodon.social/accounts/avatars/110/266/162/634/306/901/original/83169ae835e6c5ac.png", + "avatar_static": "https://files.mastodon.social/accounts/avatars/110/266/162/634/306/901/original/83169ae835e6c5ac.png", + "header": "https://files.mastodon.social/accounts/headers/110/266/162/634/306/901/original/356063731b2c5192.jpg", + "header_static": "https://files.mastodon.social/accounts/headers/110/266/162/634/306/901/original/356063731b2c5192.jpg", + "followers_count": 183830, "following_count": 6, "statuses_count": 7300, "last_status_at": + "2025-02-14", "hide_collections": false, "noindex": false, "emojis": [], "roles": + [], "fields": [{"name": "Ars Technica", "value": "https://arstechnica.com", "verified_at": + "2023-04-27T13:17:49.854+00:00"}]}}, {"source": "past_interactions", "sources": + ["friends_of_friends"], "account": {"id": "134973", "username": "amason", + "acct": "amason", "display_name": "Andrew", "locked": false, "bot": false, + "discoverable": true, "indexable": true, "group": false, "created_at": "2017-05-09T00:00:00.000Z", + "note": "

Senior Design Engineer and Frontend Developer experienced in creating + interactive UIs, visualizations, and rapid prototyping

", "url": "https://mastodon.social/@amason", + "uri": "https://mastodon.social/users/amason", "avatar": "https://files.mastodon.social/accounts/avatars/000/134/973/original/f7646c510c12ece9.jpg", + "avatar_static": "https://files.mastodon.social/accounts/avatars/000/134/973/original/f7646c510c12ece9.jpg", + "header": "https://files.mastodon.social/accounts/headers/000/134/973/original/680a2a9fc92fc719.jpg", + "header_static": "https://files.mastodon.social/accounts/headers/000/134/973/original/680a2a9fc92fc719.jpg", + "followers_count": 93, "following_count": 310, "statuses_count": 478, "last_status_at": + "2024-12-30", "hide_collections": false, "noindex": false, "emojis": [], "roles": + [], "fields": [{"name": "Website", "value": "https://coderonfire.com", "verified_at": + "2022-12-02T20:06:11.289+00:00"}]}}, {"source": "global", "sources": ["most_followed", + "most_interactions"], "account": {"id": "109332160649392039", "username": + "molly0xfff", "acct": "molly0xfff@hachyderm.io", "display_name": "Molly White", + "locked": false, "bot": false, "discoverable": true, "indexable": false, "group": + false, "created_at": "2022-11-12T00:00:00.000Z", "note": "

crypto researcher + & critic, software engineer, wikipedian \u2022 @web3isgreat + creator \u2022 newsletter: https://www.citationneeded.news/
she/her + \u2022 :QueerCat_Bisexual:

", "url": "https://hachyderm.io/@molly0xfff", + "uri": "https://hachyderm.io/users/molly0xfff", "avatar": "https://files.mastodon.social/cache/accounts/avatars/109/332/160/649/392/039/original/4186dce0328705ed.jpeg", + "avatar_static": "https://files.mastodon.social/cache/accounts/avatars/109/332/160/649/392/039/original/4186dce0328705ed.jpeg", + "header": "https://files.mastodon.social/cache/accounts/headers/109/332/160/649/392/039/original/9d71ead9a7baac53.jpeg", + "header_static": "https://files.mastodon.social/cache/accounts/headers/109/332/160/649/392/039/original/9d71ead9a7baac53.jpeg", + "followers_count": 111561, "following_count": 662, "statuses_count": 5207, + "last_status_at": "2025-02-14", "hide_collections": false, "emojis": [{"shortcode": + "QueerCat_Bisexual", "url": "https://files.mastodon.social/cache/custom_emojis/images/000/442/022/original/ab36c8483eefb031.png", + "static_url": "https://files.mastodon.social/cache/custom_emojis/images/000/442/022/static/ab36c8483eefb031.png", + "visible_in_picker": true}], "fields": [{"name": "website", "value": "https://www.mollywhite.net", "verified_at": + "2025-02-14T11:00:29.027+00:00"}, {"name": "newsletter", "value": "https://citationneeded.news/", + "verified_at": "2025-02-14T11:00:29.823+00:00"}, {"name": "store", "value": + "https://store.mollywhite.net/", + "verified_at": "2025-02-14T11:00:31.074+00:00"}, {"name": "etc", "value": + "https://www.mollywhite.net/linktree", + "verified_at": "2025-02-14T11:00:31.448+00:00"}]}}, {"source": "global", "sources": + ["most_followed", "most_interactions"], "account": {"id": "109336851987706232", + "username": "lowqualityfacts", "acct": "lowqualityfacts@mstdn.social", "display_name": + "Low Quality Facts", "locked": false, "bot": false, "discoverable": true, + "indexable": true, "group": false, "created_at": "2022-11-10T00:00:00.000Z", + "note": "

Low Quality Facts written in arguably lower quality handwriting.

", + "url": "https://mstdn.social/@lowqualityfacts", "uri": "https://mstdn.social/users/lowqualityfacts", + "avatar": "https://files.mastodon.social/cache/accounts/avatars/109/336/851/987/706/232/original/542b7a6562fefef3.jpg", + "avatar_static": "https://files.mastodon.social/cache/accounts/avatars/109/336/851/987/706/232/original/542b7a6562fefef3.jpg", + "header": "https://files.mastodon.social/cache/accounts/headers/109/336/851/987/706/232/original/da7621f38832bee6.jpg", + "header_static": "https://files.mastodon.social/cache/accounts/headers/109/336/851/987/706/232/original/da7621f38832bee6.jpg", + "followers_count": 50659, "following_count": 11418, "statuses_count": 8991, + "last_status_at": "2025-02-14", "hide_collections": false, "emojis": [], "fields": + [{"name": "Patreon", "value": "https://patreon.com/lowqualityfacts", + "verified_at": null}, {"name": "Threads", "value": "https://www.threads.net/@lowqualityfacts", + "verified_at": null}]}}, {"source": "global", "sources": ["most_followed", + "most_interactions"], "account": {"id": "412906", "username": "gruber", "acct": + "gruber", "display_name": "John Gruber", "locked": false, "bot": false, "discoverable": + true, "indexable": true, "group": false, "created_at": "2018-08-10T00:00:00.000Z", + "note": "

I write Daring Fireball, host The Talk Show, and created Markdown.

", + "url": "https://mastodon.social/@gruber", "uri": "https://mastodon.social/users/gruber", + "avatar": "https://files.mastodon.social/accounts/avatars/000/412/906/original/95c8ac0fda2b2782.png", + "avatar_static": "https://files.mastodon.social/accounts/avatars/000/412/906/original/95c8ac0fda2b2782.png", + "header": "https://files.mastodon.social/accounts/headers/000/412/906/original/2868a6722ea7d746.jpeg", + "header_static": "https://files.mastodon.social/accounts/headers/000/412/906/original/2868a6722ea7d746.jpeg", + "followers_count": 54782, "following_count": 546, "statuses_count": 6275, + "last_status_at": "2025-02-14", "hide_collections": false, "noindex": false, + "emojis": [], "roles": [], "fields": [{"name": "Web", "value": "https://daringfireball.net/", + "verified_at": "2022-12-21T23:39:53.636+00:00"}, {"name": "Threads", "value": + "https://threads.net/@gruber", + "verified_at": null}, {"name": "Bluesky", "value": "https://bsky.app/profile/gruber.foo", + "verified_at": null}, {"name": "Twitter", "value": "https://twitter.com/gruber", + "verified_at": null}]}}, {"source": "past_interactions", "sources": ["similar_to_recently_followed"], + "account": {"id": "1102", "username": "Tibor", "acct": "Tibor", "display_name": + "Tibor Martini", "locked": false, "bot": false, "discoverable": true, "indexable": + true, "group": false, "created_at": "2016-10-06T00:00:00.000Z", "note": "

Journalist, + Dev, Data \u2022 created https://www.movetodon.org \u2022 + Teamleiter Social Media @stern \u2728 \u2022 Interessiert + an: Politik, Wirtschaft, Technik, Fotografie \u2022 @werderbremen-Fan \u2022 + \ud83c\uddea\ud83c\uddfa\ud83c\udde9\ud83c\uddea\ud83c\uddfa\ud83c\uddf8\ud83c\uddee\ud83c\uddf1

", + "url": "https://mastodon.social/@Tibor", "uri": "https://mastodon.social/users/Tibor", + "avatar": "https://files.mastodon.social/accounts/avatars/000/001/102/original/ba9b6daf2e429537.png", + "avatar_static": "https://files.mastodon.social/accounts/avatars/000/001/102/original/ba9b6daf2e429537.png", + "header": "https://files.mastodon.social/accounts/headers/000/001/102/original/6a74b8028c61910b.png", + "header_static": "https://files.mastodon.social/accounts/headers/000/001/102/original/6a74b8028c61910b.png", + "followers_count": 6571, "following_count": 565, "statuses_count": 2071, "last_status_at": + "2025-02-06", "hide_collections": false, "noindex": false, "emojis": [], "roles": + [], "fields": [{"name": "tibor.net", "value": "https://tibor.net", "verified_at": + "2023-05-11T22:07:07.904+00:00"}, {"name": "Movetodon", "value": "https://www.movetodon.org", "verified_at": + "2023-05-09T14:02:43.448+00:00"}, {"name": "WhoToFollow", "value": "https://whotofollow.tibor.net", + "verified_at": "2022-11-10T22:21:28.240+00:00"}, {"name": "Raadar", "value": + "https://www.raadar.de", "verified_at": "2022-11-11T12:54:16.617+00:00"}]}}, + {"source": "global", "sources": ["most_followed", "most_interactions"], "account": + {"id": "109259296548994894", "username": "MissingThePt", "acct": "MissingThePt", + "display_name": "Missing The Point", "locked": false, "bot": false, "discoverable": + true, "indexable": true, "group": false, "created_at": "2022-10-30T00:00:00.000Z", + "note": "

Ask not for whom the point is missed. It is missed for thee.

", + "url": "https://mastodon.social/@MissingThePt", "uri": "https://mastodon.social/users/MissingThePt", + "avatar": "https://files.mastodon.social/accounts/avatars/109/259/296/548/994/894/original/3aa1c630a61f6845.jpeg", + "avatar_static": "https://files.mastodon.social/accounts/avatars/109/259/296/548/994/894/original/3aa1c630a61f6845.jpeg", + "header": "https://files.mastodon.social/accounts/headers/109/259/296/548/994/894/original/d294f548c2ccedb2.jpeg", + "header_static": "https://files.mastodon.social/accounts/headers/109/259/296/548/994/894/original/d294f548c2ccedb2.jpeg", + "followers_count": 24701, "following_count": 220, "statuses_count": 5465, + "last_status_at": "2025-02-14", "hide_collections": false, "noindex": false, + "emojis": [], "roles": [], "fields": []}}, {"source": "global", "sources": + ["most_interactions", "most_followed"], "account": {"id": "110023568395961834", + "username": "evacide", "acct": "evacide@hachyderm.io", "display_name": "evacide", + "locked": false, "bot": false, "discoverable": true, "indexable": true, "group": + false, "created_at": "2023-03-14T00:00:00.000Z", "note": "

Director of Cybersecurity
@EFF
/ + Co-founder of
@stopstalkerware
/ These are my opinions, not my employers\u2019 + / I did a TED talk once

", "url": "https://hachyderm.io/@evacide", "uri": + "https://hachyderm.io/users/evacide", "avatar": "https://files.mastodon.social/cache/accounts/avatars/110/023/568/395/961/834/original/0039cbe99c7f5acd.jpg", + "avatar_static": "https://files.mastodon.social/cache/accounts/avatars/110/023/568/395/961/834/original/0039cbe99c7f5acd.jpg", + "header": "https://files.mastodon.social/cache/accounts/headers/110/023/568/395/961/834/original/c760c8248c3d9e49.jpeg", + "header_static": "https://files.mastodon.social/cache/accounts/headers/110/023/568/395/961/834/original/c760c8248c3d9e49.jpeg", + "followers_count": 59984, "following_count": 306, "statuses_count": 1671, + "last_status_at": "2025-02-14", "hide_collections": false, "emojis": [], "fields": + []}}, {"source": "past_interactions", "sources": ["similar_to_recently_followed"], + "account": {"id": "483584", "username": "introspection", "acct": "introspection@scholar.social", + "display_name": "Guillaume Dumas", "locked": false, "bot": false, "discoverable": + true, "indexable": false, "group": false, "created_at": "2018-08-22T00:00:00.000Z", + "note": "

Dad \u00b7 Husband \u00b7 Associate Professor of Computational + Psychiatry at the University of Montreal \u00b7 PI of the Precision Psychiatry + and Social Physiology team at CHU Ste Justine \u00b7 Researcher in Social + Neuro AI at https://Mila.Quebec AI Institute \u00b7 Co-founder of 2 nonprofit + organization: ALIUS (https://aliusresearch.org) + & HackYourResearch (https://hyr.science) \u00b7 + He/Him

Topics: #CogSci, + #Consciousness, + Social #Neuroscience, + #Psychiatry, + #SysBio, #NeuroAI, + #SciML, #OpenScience, + #Commons

", + "url": "https://scholar.social/@introspection", "uri": "https://scholar.social/users/introspection", + "avatar": "https://files.mastodon.social/cache/accounts/avatars/000/483/584/original/37d8f0ec487cc1b8.jpg", + "avatar_static": "https://files.mastodon.social/cache/accounts/avatars/000/483/584/original/37d8f0ec487cc1b8.jpg", + "header": "https://files.mastodon.social/cache/accounts/headers/000/483/584/original/501c1a7752756323.jpg", + "header_static": "https://files.mastodon.social/cache/accounts/headers/000/483/584/original/501c1a7752756323.jpg", + "followers_count": 1136, "following_count": 466, "statuses_count": 89, "last_status_at": + "2023-10-15", "hide_collections": false, "emojis": [], "fields": [{"name": + "\ud83c\udf0e Website", "value": "https://www.extrospection.eu", + "verified_at": "2025-02-07T20:00:47.995+00:00"}, {"name": "\ud83d\udc65 Lab", + "value": "https://www.ppsp.team", "verified_at": null}, {"name": "\ud83c\udf93 + Publications", "value": "https://scholar.google.com/citations?user=TakXk9MAAAAJ", + "verified_at": null}, {"name": "\ud83d\udc26 Birdsite", "value": "https://twitter.com/introspection", + "verified_at": null}]}}, {"source": "global", "sources": ["most_followed", + "most_interactions"], "account": {"id": "109251088201008636", "username": + "Sheril", "acct": "Sheril", "display_name": "Sheril Kirshenbaum", "locked": + false, "bot": false, "discoverable": true, "indexable": false, "group": false, + "created_at": "2022-10-29T00:00:00.000Z", "note": "

CFR fellow in the U.S. + Senate. Scientist. Author. Host of PBS Serving Up Science. #HistoryRemix for stories + of diverse trailblazers in science & the arts. #SharedPlanet to explore + biodiversity

", "url": "https://mastodon.social/@Sheril", "uri": "https://mastodon.social/users/Sheril", + "avatar": "https://files.mastodon.social/accounts/avatars/109/251/088/201/008/636/original/e8e7f344256a741f.png", + "avatar_static": "https://files.mastodon.social/accounts/avatars/109/251/088/201/008/636/original/e8e7f344256a741f.png", + "header": "https://files.mastodon.social/accounts/headers/109/251/088/201/008/636/original/0e752bd169847870.jpg", + "header_static": "https://files.mastodon.social/accounts/headers/109/251/088/201/008/636/original/0e752bd169847870.jpg", + "followers_count": 65386, "following_count": 210, "statuses_count": 1435, + "last_status_at": "2025-02-14", "hide_collections": false, "noindex": false, + "emojis": [], "roles": [], "fields": []}}, {"source": "global", "sources": + ["most_followed", "most_interactions"], "account": {"id": "109246884833502206", + "username": "nocontexttrek", "acct": "nocontexttrek", "display_name": "Star + Trek Minus Context", "locked": false, "bot": false, "discoverable": true, + "indexable": false, "group": false, "created_at": "2022-10-28T00:00:00.000Z", + "note": "

Double dumbass on you, and so forth. (These are all real) #StarTrek\ud83d\udd96\ud83c\udffc
Same account from twitter, also on bsky. If you want to Venmo a tip, find + me at @JRE_LLAP

#StarTrekTNG #StarTrekTOS #StarTrekVoyager #StarTrekLowerDecks #StarTrekDiscovery + #StarTrekDS9 #StarTrekPicard #StarTrekEnterprise #Space #Astronomy #Science #AltText

", "url": + "https://mastodon.social/@nocontexttrek", "uri": "https://mastodon.social/users/nocontexttrek", + "avatar": "https://files.mastodon.social/accounts/avatars/109/246/884/833/502/206/original/7a68fc87a820d5e6.jpg", + "avatar_static": "https://files.mastodon.social/accounts/avatars/109/246/884/833/502/206/original/7a68fc87a820d5e6.jpg", + "header": "https://files.mastodon.social/accounts/headers/109/246/884/833/502/206/original/a9f04119f8c0d8c4.jpg", + "header_static": "https://files.mastodon.social/accounts/headers/109/246/884/833/502/206/original/a9f04119f8c0d8c4.jpg", + "followers_count": 39657, "following_count": 84, "statuses_count": 2219, "last_status_at": + "2025-02-14", "hide_collections": false, "noindex": false, "emojis": [], "roles": + [], "fields": []}}, {"source": "global", "sources": ["most_interactions", + "most_followed"], "account": {"id": "109742206677653822", "username": "stroughtonsmith", + "acct": "stroughtonsmith", "display_name": "Steve Troughton-Smith", "locked": + false, "bot": false, "discoverable": true, "indexable": true, "group": false, + "created_at": "2023-01-24T00:00:00.000Z", "note": "

App developer & + mini painter. I make apps and break things.

UIKit. Swift. PC Gaming. + Warhammer. Husband. \ud83c\udff3\ufe0f\u200d\ud83c\udf08 He/him.

", "url": + "https://mastodon.social/@stroughtonsmith", "uri": "https://mastodon.social/users/stroughtonsmith", + "avatar": "https://files.mastodon.social/accounts/avatars/109/742/206/677/653/822/original/cf30d22950290178.jpeg", + "avatar_static": "https://files.mastodon.social/accounts/avatars/109/742/206/677/653/822/original/cf30d22950290178.jpeg", + "header": "https://files.mastodon.social/accounts/headers/109/742/206/677/653/822/original/e250c5e001942295.jpeg", + "header_static": "https://files.mastodon.social/accounts/headers/109/742/206/677/653/822/original/e250c5e001942295.jpeg", + "followers_count": 28289, "following_count": 497, "statuses_count": 9240, + "last_status_at": "2025-02-14", "hide_collections": false, "noindex": false, + "emojis": [], "roles": [], "fields": [{"name": "Web", "value": "https://www.highcaffeinecontent.com/", + "verified_at": "2023-10-14T04:24:15.262+00:00"}, {"name": "Patreon", "value": + "https://www.patreon.com/steventroughtonsmith", + "verified_at": null}, {"name": "GitHub", "value": "https://github.com/steventroughtonsmith", + "verified_at": "2023-02-09T19:12:42.661+00:00"}, {"name": "Source Code Projects + for Sale", "value": "https://steventroughtonsmith.gumroad.com", + "verified_at": null}]}}, {"source": "past_interactions", "sources": ["friends_of_friends"], + "account": {"id": "650308", "username": "neauoire", "acct": "neauoire@merveilles.town", + "display_name": "Devine Lu Linvega", "locked": false, "bot": false, "discoverable": + true, "indexable": false, "group": false, "created_at": "2018-12-14T00:00:00.000Z", + "note": "

It\u2019s always night under the ultraviolet sun.

", "url": + "https://merveilles.town/@neauoire", "uri": "https://merveilles.town/users/neauoire", + "avatar": "https://files.mastodon.social/cache/accounts/avatars/000/650/308/original/5ae5878c41fa395e.jpg", + "avatar_static": "https://files.mastodon.social/cache/accounts/avatars/000/650/308/original/5ae5878c41fa395e.jpg", + "header": "https://files.mastodon.social/accounts/headers/000/650/308/original/656c8534c53c1152.jpeg", + "header_static": "https://files.mastodon.social/accounts/headers/000/650/308/original/656c8534c53c1152.jpeg", + "followers_count": 13183, "following_count": 1133, "statuses_count": 73540, + "last_status_at": "2025-02-14", "hide_collections": false, "emojis": [], "fields": + [{"name": "memex", "value": "https://wiki.xxiivv.com", "verified_at": + "2025-02-14T18:14:27.331+00:00"}, {"name": "seasteading", "value": "https://100r.co", "verified_at": + "2025-02-14T18:14:27.603+00:00"}, {"name": "No Pipelines!", "value": "https://unistoten.camp/no-pipelines/", + "verified_at": null}]}}, {"source": "past_interactions", "sources": ["friends_of_friends"], + "account": {"id": "424871", "username": "aobehr", "acct": "aobehr", "display_name": + "Stoned Comedian Ringo", "locked": false, "bot": false, "discoverable": true, + "indexable": false, "group": false, "created_at": "2018-08-16T00:00:00.000Z", + "note": "

Do not think about your stupid enemies or entertain any other + disgusting thoughts.

", "url": "https://mastodon.social/@aobehr", "uri": + "https://mastodon.social/users/aobehr", "avatar": "https://files.mastodon.social/accounts/avatars/000/424/871/original/f1793bae0e6c88b8.jpg", + "avatar_static": "https://files.mastodon.social/accounts/avatars/000/424/871/original/f1793bae0e6c88b8.jpg", + "header": "https://files.mastodon.social/accounts/headers/000/424/871/original/6a4b7e66e265b727.jpg", + "header_static": "https://files.mastodon.social/accounts/headers/000/424/871/original/6a4b7e66e265b727.jpg", + "followers_count": 167, "following_count": 172, "statuses_count": 204, "last_status_at": + "2022-11-18", "hide_collections": false, "noindex": false, "emojis": [], "roles": + [], "fields": [{"name": "Things I LIke", "value": "Fun", "verified_at": null}]}}, + {"source": "past_interactions", "sources": ["similar_to_recently_followed"], + "account": {"id": "109292665610187066", "username": "smallcircles", "acct": + "smallcircles@social.coop", "display_name": "small circle \ud83d\udd4a in + calmness", "locked": false, "bot": false, "discoverable": true, "indexable": + false, "group": false, "created_at": "2022-11-05T00:00:00.000Z", "note": "

Fedizens. + We dream! \u270a

We dream that one day, not far from here,
\ud83d\udc83\ud83d\udd7a + peopleverse shall arise on our fedi,
Standing firmly on its open social + stack,
Built by people from across our circles,
To be united in their + hunger for peace \ud83d\udd4a\ufe0f

Let''s surf delicious social fabric!
*Invest* + in shared social experience,
To live happier forever after.

Radiate + \ud83d\udc95 Humanness
Spray \u2728 Sparks of Joy
Enjoy \ud83d\udc8e + Gems of Freedom
Weave \ud83d\udd2e Essence of Life
Just \ud83d\udc7e + Walk your Dreams.

Giving 2 cts
CC-BY-NC-SA @humanetech

", "url": + "https://social.coop/@smallcircles", "uri": "https://social.coop/users/smallcircles", + "avatar": "https://files.mastodon.social/cache/accounts/avatars/109/292/665/610/187/066/original/a8e343e8c080e267.png", + "avatar_static": "https://files.mastodon.social/cache/accounts/avatars/109/292/665/610/187/066/original/a8e343e8c080e267.png", + "header": "https://files.mastodon.social/cache/accounts/headers/109/292/665/610/187/066/original/34dd48c6074f888a.jpg", + "header_static": "https://files.mastodon.social/cache/accounts/headers/109/292/665/610/187/066/original/34dd48c6074f888a.jpg", + "followers_count": 6456, "following_count": 910, "statuses_count": 1142, "last_status_at": + "2025-02-14", "hide_collections": false, "emojis": [], "fields": [{"name": + "Emerging", "value": "https://discuss.coding.social", + "verified_at": "2025-02-14T11:32:41.595+00:00"}, {"name": "Nurturing", "value": + "https://fedi.foundation", "verified_at": null}, {"name": "Dispersing", + "value": "https://innercircles.community", + "verified_at": null}, {"name": "Transferring", "value": "https://community.humanetech.com", + "verified_at": "2025-02-14T11:32:42.624+00:00"}]}}, {"source": "past_interactions", + "sources": ["friends_of_friends"], "account": {"id": "221692", "username": + "dendycrew", "acct": "dendycrew", "display_name": "dendy crew", "locked": + false, "bot": false, "discoverable": true, "indexable": false, "group": false, + "created_at": "2017-10-24T00:00:00.000Z", "note": "

lets enjoy toots together + and have safe fun on the web ;-) you can get my albums at the link below

http://www.dendycrew.com

", "url": "https://mastodon.social/@dendycrew", + "uri": "https://mastodon.social/users/dendycrew", "avatar": "https://files.mastodon.social/accounts/avatars/000/221/692/original/ee16cef23e6d667a2878e75430f75a01.gif", + "avatar_static": "https://files.mastodon.social/accounts/avatars/000/221/692/static/ee16cef23e6d667a2878e75430f75a01.png", + "header": "https://files.mastodon.social/accounts/headers/000/221/692/original/a7c660f13587945e.png", + "header_static": "https://files.mastodon.social/accounts/headers/000/221/692/original/a7c660f13587945e.png", + "followers_count": 294, "following_count": 44, "statuses_count": 218, "last_status_at": + "2024-08-29", "hide_collections": false, "noindex": true, "emojis": [], "roles": + [], "fields": [{"name": "discord", "value": "dendycrew#8020", "verified_at": + null}]}}, {"source": "global", "sources": ["most_interactions", "most_followed"], + "account": {"id": "109297938816143758", "username": "w7voa", "acct": "w7voa@journa.host", + "display_name": "Steve Herman", "locked": false, "bot": false, "discoverable": + true, "indexable": true, "group": false, "created_at": "2022-11-06T00:00:00.000Z", + "note": "

Personal/unofficial account of VOA\u2019s chief national correspondent/former + White House bureau chief; Author, \u2018Behind the White House Curtain.\u2019 + Adjunct asst. professor, Shenandoah Univ.; Adjunct lecturer in journalism, + Univ. of Richmond; 2022-23 @JURISTnews + journalist-in-residence, Univ. of Pittsburgh School of Law; Kiplinger Fellow, + Ohio Univ.; CFR higher education ambassador; Nevada Broadcasters Assoc. Hall + of Fame; W7VOA on ham radio.

", "url": "https://journa.host/@w7voa", "uri": + "https://journa.host/users/w7voa", "avatar": "https://files.mastodon.social/cache/accounts/avatars/109/297/938/816/143/758/original/ff155bbefb195887.png", + "avatar_static": "https://files.mastodon.social/cache/accounts/avatars/109/297/938/816/143/758/original/ff155bbefb195887.png", + "header": "https://files.mastodon.social/cache/accounts/headers/109/297/938/816/143/758/original/364d98d59c6ba398.png", + "header_static": "https://files.mastodon.social/cache/accounts/headers/109/297/938/816/143/758/original/364d98d59c6ba398.png", + "followers_count": 66436, "following_count": 979, "statuses_count": 16241, + "last_status_at": "2025-02-14", "hide_collections": false, "emojis": [], "fields": + []}}, {"source": "global", "sources": ["most_interactions", "most_followed"], + "account": {"id": "112339386306332928", "username": "kottke", "acct": "kottke", + "display_name": "kottke.org", "locked": false, "bot": false, "discoverable": + true, "indexable": true, "group": false, "created_at": "2024-04-26T00:00:00.000Z", + "note": "

home of fine hypertext products since 1998

", "url": "https://mastodon.social/@kottke", + "uri": "https://mastodon.social/users/kottke", "avatar": "https://files.mastodon.social/accounts/avatars/112/339/386/306/332/928/original/fc720e7b1362a077.png", + "avatar_static": "https://files.mastodon.social/accounts/avatars/112/339/386/306/332/928/original/fc720e7b1362a077.png", + "header": "https://mastodon.social/headers/original/missing.png", "header_static": + "https://mastodon.social/headers/original/missing.png", "followers_count": + 19077, "following_count": 26, "statuses_count": 1728, "last_status_at": "2025-02-14", + "hide_collections": false, "noindex": false, "emojis": [], "roles": [], "fields": + [{"name": "internet", "value": "https://kottke.org", "verified_at": + "2024-04-27T02:24:03.443+00:00"}]}}, {"source": "global", "sources": ["most_followed", + "most_interactions"], "account": {"id": "109371633990500550", "username": + "streetartutopia", "acct": "streetartutopia@mastodon.online", "display_name": + "Street Art Utopia", "locked": false, "bot": false, "discoverable": true, + "indexable": true, "group": false, "created_at": "2022-11-06T00:00:00.000Z", + "note": "

We declare the world as our canvas!

Blog Posts about inspiring + street art: https://streetartutopia.com/

#streetartutopia + #streetart #graffiti #publicart + #mural

BlueSky: https://bsky.app/profile/streetartutopia.bsky.social

", + "url": "https://mastodon.online/@streetartutopia", "uri": "https://mastodon.online/users/streetartutopia", + "avatar": "https://files.mastodon.social/cache/accounts/avatars/109/371/633/990/500/550/original/deca849b342f7f2c.jpg", + "avatar_static": "https://files.mastodon.social/cache/accounts/avatars/109/371/633/990/500/550/original/deca849b342f7f2c.jpg", + "header": "https://mastodon.social/headers/original/missing.png", "header_static": + "https://mastodon.social/headers/original/missing.png", "followers_count": + 14941, "following_count": 68, "statuses_count": 1778, "last_status_at": "2025-02-14", + "hide_collections": false, "emojis": [], "fields": [{"name": "Website", "value": + "http://streetartutopia.com/", "verified_at": null}]}}, {"source": "past_interactions", + "sources": ["similar_to_recently_followed"], "account": {"id": "109207520642028304", + "username": "ruchowdh", "acct": "ruchowdh", "display_name": "Rumman Chowdhury", + "locked": false, "bot": false, "discoverable": true, "indexable": false, "group": + false, "created_at": "2022-10-21T00:00:00.000Z", "note": "

Responsible AI. + Anti Elon Social Club.

", "url": "https://mastodon.social/@ruchowdh", "uri": + "https://mastodon.social/users/ruchowdh", "avatar": "https://files.mastodon.social/accounts/avatars/109/207/520/642/028/304/original/ec512e658f907d70.png", + "avatar_static": "https://files.mastodon.social/accounts/avatars/109/207/520/642/028/304/original/ec512e658f907d70.png", + "header": "https://mastodon.social/headers/original/missing.png", "header_static": + "https://mastodon.social/headers/original/missing.png", "followers_count": + 6616, "following_count": 224, "statuses_count": 312, "last_status_at": "2023-04-22", + "hide_collections": false, "noindex": false, "emojis": [], "roles": [], "fields": + []}}, {"source": "past_interactions", "sources": ["friends_of_friends"], "account": + {"id": "18657", "username": "rpgwhitelock", "acct": "rpgwhitelock", "display_name": + "Richard Whitelock", "locked": false, "bot": false, "discoverable": true, + "indexable": false, "group": false, "created_at": "2017-01-02T00:00:00.000Z", + "note": "

UK based games artist with over two decades experience in art + direction, technical art, environments, lighting & FX. I love making atmospheric + and evocative worlds!

Quiet as a Stone. AllSky. Frozen Cortex. Frozen + Synapse 2. Flock.

#gamedev #unity #unreal #godot #techart #lighting #art #gameart #photography

", + "url": "https://mastodon.social/@rpgwhitelock", "uri": "https://mastodon.social/users/rpgwhitelock", + "avatar": "https://files.mastodon.social/accounts/avatars/000/018/657/original/a4c9082b1cd922f3.png", + "avatar_static": "https://files.mastodon.social/accounts/avatars/000/018/657/original/a4c9082b1cd922f3.png", + "header": "https://files.mastodon.social/accounts/headers/000/018/657/original/c1cfcd16e59e35eb.png", + "header_static": "https://files.mastodon.social/accounts/headers/000/018/657/original/c1cfcd16e59e35eb.png", + "followers_count": 112, "following_count": 102, "statuses_count": 9, "last_status_at": + "2023-07-05", "hide_collections": false, "noindex": false, "emojis": [], "roles": + [], "fields": [{"name": "website", "value": "www.richardwhitelock.com", "verified_at": + null}]}}, {"source": "past_interactions", "sources": ["similar_to_recently_followed"], + "account": {"id": "109422800122306215", "username": "a_watch", "acct": "a_watch@bewegung.social", + "display_name": "abgeordnetenwatch", "locked": false, "bot": false, "discoverable": + true, "indexable": false, "group": false, "created_at": "2022-11-28T00:00:00.000Z", + "note": "

F\u00fcr mehr Transparenz in der Politik. Frageplattform, Recherchen, + Petitionen.
Hier postet unser Team.

Datenschutz: https://www.abgeordnetenwatch.de/datenschutzerklaerung-social-media +
Impressum: https://www.abgeordnetenwatch.de/ueber-uns/impressum

", + "url": "https://bewegung.social/@a_watch", "uri": "https://bewegung.social/users/a_watch", + "avatar": "https://files.mastodon.social/cache/accounts/avatars/109/422/800/122/306/215/original/bbd33ff1929b9a04.jpg", + "avatar_static": "https://files.mastodon.social/cache/accounts/avatars/109/422/800/122/306/215/original/bbd33ff1929b9a04.jpg", + "header": "https://files.mastodon.social/cache/accounts/headers/109/422/800/122/306/215/original/1e1e49e837b5ebec.png", + "header_static": "https://files.mastodon.social/cache/accounts/headers/109/422/800/122/306/215/original/1e1e49e837b5ebec.png", + "followers_count": 28122, "following_count": 479, "statuses_count": 1911, + "last_status_at": "2025-02-14", "hide_collections": false, "emojis": [], "fields": + [{"name": "Recherchen:", "value": "https://www.abgeordnetenwatch.de/recherchen", + "verified_at": "2025-02-14T18:13:37.004+00:00"}, {"name": "Website:", "value": + "https://www.abgeordnetenwatch.de", + "verified_at": "2025-02-14T18:13:37.135+00:00"}, {"name": "Newsletter:", "value": + "https://www.abgeordnetenwatch.de/newsletter", + "verified_at": "2025-02-14T18:13:37.657+00:00"}, {"name": "Spenden:", "value": + "https://www.abgeordnetenwatch.de/ueber-uns/spendenformular", + "verified_at": "2025-02-14T18:13:38.072+00:00"}]}}, {"source": "global", "sources": + ["most_followed", "most_interactions"], "account": {"id": "109363193416754359", + "username": "godpod", "acct": "godpod@universeodon.com", "display_name": "God + :verified:", "locked": false, "bot": false, "discoverable": true, "indexable": + false, "group": false, "created_at": "2022-11-18T00:00:00.000Z", "note": "

Welcome, + mortals! I\u2019m God! Follow to unlock the mysteries of the universe.

", + "url": "https://universeodon.com/@godpod", "uri": "https://universeodon.com/users/godpod", + "avatar": "https://files.mastodon.social/cache/accounts/avatars/109/363/193/416/754/359/original/076bfc1d88d33202.jpg", + "avatar_static": "https://files.mastodon.social/cache/accounts/avatars/109/363/193/416/754/359/original/076bfc1d88d33202.jpg", + "header": "https://files.mastodon.social/cache/accounts/headers/109/363/193/416/754/359/original/9238a3120e2c8705.jpg", + "header_static": "https://files.mastodon.social/cache/accounts/headers/109/363/193/416/754/359/original/9238a3120e2c8705.jpg", + "followers_count": 139828, "following_count": 173, "statuses_count": 1433, + "last_status_at": "2025-02-14", "hide_collections": false, "emojis": [{"shortcode": + "verified", "url": "https://files.mastodon.social/cache/custom_emojis/images/000/452/462/original/947cae7ac4dfdfa0.png", + "static_url": "https://files.mastodon.social/cache/custom_emojis/images/000/452/462/static/947cae7ac4dfdfa0.png", + "visible_in_picker": true}], "fields": [{"name": "Twitch", "value": "https://twitch.tv/TheGodPod", + "verified_at": null}, {"name": "YouTube", "value": "https://youtube.com/c/TheGodPod", + "verified_at": null}, {"name": "Discord", "value": "https://discord.gg/2sEyFPh", + "verified_at": null}]}}, {"source": "global", "sources": ["most_followed", + "most_interactions"], "account": {"id": "109304304394345014", "username": + "briankrebs", "acct": "briankrebs@infosec.exchange", "display_name": "BrianKrebs", + "locked": false, "bot": false, "discoverable": true, "indexable": true, "group": + false, "created_at": "2022-11-05T00:00:00.000Z", "note": "

Independent investigative + journalist. Covers cybercrime, security, privacy. Author of ''Spam Nation,'' + a NYT bestseller. Former Washington Post reporter, ''95-''09. Signal: briankrebs.07 + Twitter: @briankrebs + Linkedin: https://www.linkedin.com/in/bkrebs/

", + "url": "https://infosec.exchange/@briankrebs", "uri": "https://infosec.exchange/users/briankrebs", + "avatar": "https://files.mastodon.social/cache/accounts/avatars/109/304/304/394/345/014/original/abbd8e5fb821bd1f.png", + "avatar_static": "https://files.mastodon.social/cache/accounts/avatars/109/304/304/394/345/014/original/abbd8e5fb821bd1f.png", + "header": "https://files.mastodon.social/cache/accounts/headers/109/304/304/394/345/014/original/4010eecff6882627.png", + "header_static": "https://files.mastodon.social/cache/accounts/headers/109/304/304/394/345/014/original/4010eecff6882627.png", + "followers_count": 88911, "following_count": 1035, "statuses_count": 9703, + "last_status_at": "2025-02-14", "hide_collections": false, "emojis": [], "fields": + [{"name": "website", "value": "https://krebsonsecurity.com", + "verified_at": "2025-02-14T09:36:23.457+00:00"}]}}, {"source": "staff", "sources": + ["featured", "most_followed", "most_interactions"], "account": {"id": "233670", + "username": "warandpeas", "acct": "warandpeas", "display_name": "War and Peas + \ud83e\uddff", "locked": false, "bot": false, "discoverable": true, "indexable": + false, "group": false, "created_at": "2017-11-13T00:00:00.000Z", "note": "

Comics

", + "url": "https://mastodon.social/@warandpeas", "uri": "https://mastodon.social/users/warandpeas", + "avatar": "https://files.mastodon.social/accounts/avatars/000/233/670/original/c051f22ff243a7a5.jpg", + "avatar_static": "https://files.mastodon.social/accounts/avatars/000/233/670/original/c051f22ff243a7a5.jpg", + "header": "https://files.mastodon.social/accounts/headers/000/233/670/original/57a8f90cd487b7c3.jpg", + "header_static": "https://files.mastodon.social/accounts/headers/000/233/670/original/57a8f90cd487b7c3.jpg", + "followers_count": 80954, "following_count": 38, "statuses_count": 1399, "last_status_at": + "2025-02-13", "hide_collections": false, "noindex": false, "emojis": [], "roles": + [], "fields": [{"name": "Website", "value": "https://warandpeas.com", "verified_at": + "2023-08-07T10:50:05.892+00:00"}, {"name": "Shop", "value": "https://warandpeas.shop", "verified_at": + null}, {"name": "All Links", "value": "https://warandpeas.com/linktree/", + "verified_at": "2024-06-05T11:35:56.792+00:00"}, {"name": "Patreon", "value": + "https://www.patreon.com/warandpeas", + "verified_at": null}]}}, {"source": "global", "sources": ["most_followed", + "most_interactions"], "account": {"id": "691094", "username": "jwz", "acct": + "jwz", "display_name": "jwz", "locked": false, "bot": false, "discoverable": + true, "indexable": true, "group": false, "created_at": "2019-01-18T00:00:00.000Z", + "note": "

I write screen savers and sell beer. Impresario of DNA Lounge, + the world's greatest nightclub. Also wrote your parents' web browser + and stuff.

", "url": "https://mastodon.social/@jwz", "uri": "https://mastodon.social/users/jwz", + "avatar": "https://files.mastodon.social/accounts/avatars/000/691/094/original/6444289115b174f8.gif", + "avatar_static": "https://files.mastodon.social/accounts/avatars/000/691/094/static/6444289115b174f8.png", + "header": "https://files.mastodon.social/accounts/headers/000/691/094/original/145356705b39c584.png", + "header_static": "https://files.mastodon.social/accounts/headers/000/691/094/original/145356705b39c584.png", + "followers_count": 18289, "following_count": 280, "statuses_count": 10630, + "last_status_at": "2025-02-14", "hide_collections": false, "noindex": false, + "emojis": [], "roles": [], "fields": [{"name": "jwz.org", "value": "https://www.jwz.org/", "verified_at": + "2022-11-29T01:52:57.032+00:00"}, {"name": "@dnalounge", "value": "https://sfba.social/@dnalounge", + "verified_at": null}, {"name": "@dnapizza", "value": "https://sfba.social/@dnapizza", + "verified_at": null}]}}, {"source": "past_interactions", "sources": ["friends_of_friends"], + "account": {"id": "24853", "username": "resir014", "acct": "resir014@icosahedron.website", + "display_name": "Resi Respati :icosahedron:", "locked": false, "bot": false, + "discoverable": true, "indexable": false, "group": false, "created_at": "2017-02-28T00:00:00.000Z", + "note": "

Web developer by day, content creator and washed up Trackmania + player by night. \u00b7 Tech team @ https://iwag.furries.id \u00b7 + Streams at https://twitch.tv/resir014 + \u00b7 Opinions mine.

#nobot + #webdev #gaming + #Trackmania #motorsports + #programming + #technology #fedi22

", + "url": "https://icosahedron.website/@resir014", "uri": "https://icosahedron.website/users/resir014", + "avatar": "https://files.mastodon.social/cache/accounts/avatars/000/024/853/original/4e63ff877624863e.png", + "avatar_static": "https://files.mastodon.social/cache/accounts/avatars/000/024/853/original/4e63ff877624863e.png", + "header": "https://files.mastodon.social/cache/accounts/headers/000/024/853/original/0b5fd65a79f77953.jpg", + "header_static": "https://files.mastodon.social/cache/accounts/headers/000/024/853/original/0b5fd65a79f77953.jpg", + "followers_count": 475, "following_count": 448, "statuses_count": 1877, "last_status_at": + "2025-01-25", "hide_collections": false, "emojis": [{"shortcode": "icosahedron", + "url": "https://files.mastodon.social/cache/custom_emojis/images/000/002/116/original/e0d448640e549b87.png", + "static_url": "https://files.mastodon.social/cache/custom_emojis/images/000/002/116/static/e0d448640e549b87.png", + "visible_in_picker": true}], "fields": [{"name": "Pronouns", "value": "he/him", + "verified_at": null}, {"name": "Languages", "value": "EN/ID", "verified_at": + null}, {"name": "Website", "value": "https://resir014.xyz/", "verified_at": + "2025-01-19T14:07:50.500+00:00"}, {"name": "Linktree", "value": "https://resir014.xyz/linktree", + "verified_at": "2025-01-19T14:07:50.691+00:00"}]}}, {"source": "past_interactions", + "sources": ["friends_of_friends"], "account": {"id": "179774", "username": + "SwooshyCueb", "acct": "SwooshyCueb@chitter.xyz", "display_name": "Markus", + "locked": false, "bot": false, "discoverable": true, "indexable": false, "group": + false, "created_at": "2017-06-30T00:00:00.000Z", "note": "

Professional + code butcher. Hobbyist musician.

I''m that weirdo who actually likes + systemd.

he/him/his
Queer (cis polyamorous panromantic phallocentric-pansexual)
White + settler.
The sun has been trying to kill me for about 31 years.

If + you''re below the age of majority in your country, you shouldn''t follow me.

I + often use a client that can''t display pinned toots, profile metadata, and + sometimes bios.

It''s okay to boost my unlisted posts.

Our imaginary + is too constrained by the contemporary.

", "url": "https://chitter.xyz/@SwooshyCueb", + "uri": "https://chitter.xyz/users/SwooshyCueb", "avatar": "https://files.mastodon.social/cache/accounts/avatars/000/179/774/original/0c8af5ee594743d4.png", + "avatar_static": "https://files.mastodon.social/cache/accounts/avatars/000/179/774/original/0c8af5ee594743d4.png", + "header": "https://files.mastodon.social/accounts/headers/000/179/774/original/074747f5ebc6fe66.jpeg", + "header_static": "https://files.mastodon.social/accounts/headers/000/179/774/original/074747f5ebc6fe66.jpeg", + "followers_count": 1295, "following_count": 2856, "statuses_count": 17206, + "last_status_at": "2025-02-14", "hide_collections": true, "emojis": [], "fields": + [{"name": "Twitch", "value": "https://www.twitch.tv/SwooshyCueb", + "verified_at": null}, {"name": "AniList", "value": "https://anilist.co/user/SwooshyCueb/", + "verified_at": null}, {"name": "GitHub", "value": "https://github.com/SwooshyCueb", + "verified_at": "2025-02-14T07:56:34.358+00:00"}, {"name": "Location", "value": + "Occupied Muscogee territory", "verified_at": null}]}}, {"source": "global", + "sources": ["most_followed", "most_interactions"], "account": {"id": "39207", + "username": "bagder", "acct": "bagder", "display_name": "daniel:// stenberg://", + "locked": false, "bot": false, "discoverable": true, "indexable": true, "group": + false, "created_at": "2017-04-03T00:00:00.000Z", "note": "

I write curl. + I don't know anything.

", "url": "https://mastodon.social/@bagder", + "uri": "https://mastodon.social/users/bagder", "avatar": "https://files.mastodon.social/accounts/avatars/000/039/207/original/972a88b4292b90af.jpg", + "avatar_static": "https://files.mastodon.social/accounts/avatars/000/039/207/original/972a88b4292b90af.jpg", + "header": "https://files.mastodon.social/accounts/headers/000/039/207/original/14b6fb808cf09ba2.jpg", + "header_static": "https://files.mastodon.social/accounts/headers/000/039/207/original/14b6fb808cf09ba2.jpg", + "followers_count": 28057, "following_count": 257, "statuses_count": 6949, + "last_status_at": "2025-02-14", "hide_collections": false, "noindex": false, + "emojis": [], "roles": [], "fields": [{"name": "website", "value": "https://daniel.haxx.se/", "verified_at": + "2022-11-10T22:47:00.998+00:00"}, {"name": "github", "value": "https://github.com/bagder", + "verified_at": "2023-02-02T09:32:48.852+00:00"}]}}, {"source": "past_interactions", + "sources": ["friends_of_friends"], "account": {"id": "941652", "username": + "acegikmo", "acct": "acegikmo", "display_name": "Freya Holm\u00e9r", "locked": + false, "bot": false, "discoverable": true, "indexable": false, "group": false, + "created_at": "2019-10-13T00:00:00.000Z", "note": "

\u2b55 I made Shapes + & Shader Forge
\ud83d\udd25 shader sorceress
\ud83c\udfa8 artist
\ud83d\udccf math influencer
\ud83d\udc9c twitch partner
\ud83d\udce1 + ex-founder of @NeatCorp

pfp by @JellyEnvy on twitter
banner by + @YO_SU_RA on twitter

", "url": "https://mastodon.social/@acegikmo", "uri": + "https://mastodon.social/users/acegikmo", "avatar": "https://files.mastodon.social/accounts/avatars/000/941/652/original/89f940974aec436f.png", + "avatar_static": "https://files.mastodon.social/accounts/avatars/000/941/652/original/89f940974aec436f.png", + "header": "https://files.mastodon.social/accounts/headers/000/941/652/original/1083f585f8e6c9ec.jpg", + "header_static": "https://files.mastodon.social/accounts/headers/000/941/652/original/1083f585f8e6c9ec.jpg", + "followers_count": 11744, "following_count": 33, "statuses_count": 724, "last_status_at": + "2025-01-31", "hide_collections": false, "noindex": false, "emojis": [], "roles": + [], "fields": [{"name": "\ud83d\udc26 twitter", "value": "twitter.com/FreyaHolmer", + "verified_at": null}, {"name": "\ud83c\udfa5 youtube", "value": "youtube.com/acegikmo", + "verified_at": null}, {"name": "she/her", "value": "", "verified_at": null}]}}, + {"source": "past_interactions", "sources": ["friends_of_friends"], "account": + {"id": "109316419389604399", "username": "creatrixtiara", "acct": "creatrixtiara@mage.town", + "display_name": "Creatrix Tiara", "locked": false, "bot": false, "discoverable": + true, "indexable": false, "group": false, "created_at": "2022-11-09T00:00:00.000Z", + "note": "

Third time lucky on Mastodon (formerly: mastodon.social and vulpine.club). + Got infamous for dealing with racial harassment on here but hoping to be known + for more than that!

I got up to shenanigans, then got waylaid for most + of 2022, and am now trying to get back into shenanigans. Creative producing, + performance art, writing, video games, media-making, activism, community cultural + development, advocacy, arts management ++

Queer, genderqueer, immigrant, + disabled, neurodivergent, PoC

", "url": "https://mage.town/@creatrixtiara", + "uri": "https://mage.town/users/creatrixtiara", "avatar": "https://files.mastodon.social/cache/accounts/avatars/109/316/419/389/604/399/original/cdcacbdc667ac24b.png", + "avatar_static": "https://files.mastodon.social/cache/accounts/avatars/109/316/419/389/604/399/original/cdcacbdc667ac24b.png", + "header": "https://files.mastodon.social/cache/accounts/headers/109/316/419/389/604/399/original/07d8682747104094.jpg", + "header_static": "https://files.mastodon.social/cache/accounts/headers/109/316/419/389/604/399/original/07d8682747104094.jpg", + "followers_count": 2401, "following_count": 1250, "statuses_count": 1462, + "last_status_at": "2024-06-03", "hide_collections": false, "emojis": [], "fields": + [{"name": "Pronouns", "value": "they/them", "verified_at": null}, {"name": + "Location", "value": "Melbs AU", "verified_at": null}, {"name": "Website", + "value": "creatrixtiara.com", "verified_at": null}, {"name": "Also @creatrixtiara + on", "value": "Twitter, TikTok, Instagram", "verified_at": null}]}}, {"source": + "past_interactions", "sources": ["friends_of_friends"], "account": {"id": + "16021", "username": "batterpunts", "acct": "batterpunts", "display_name": + "Butterpants \ud83d\udd8b", "locked": true, "bot": false, "discoverable": + true, "indexable": false, "group": false, "created_at": "2016-11-27T00:00:00.000Z", + "note": "

Ontologically Healthy, Cautiously Reforming Abject Principles.
https://ko-fi.com/batterpunts

", + "url": "https://mastodon.social/@batterpunts", "uri": "https://mastodon.social/users/batterpunts", + "avatar": "https://files.mastodon.social/accounts/avatars/000/016/021/original/59b24472fef91aa1.png", + "avatar_static": "https://files.mastodon.social/accounts/avatars/000/016/021/original/59b24472fef91aa1.png", + "header": "https://files.mastodon.social/accounts/headers/000/016/021/original/9e91d816e0ce8408.jpg", + "header_static": "https://files.mastodon.social/accounts/headers/000/016/021/original/9e91d816e0ce8408.jpg", + "followers_count": 302, "following_count": 81, "statuses_count": 30793, "last_status_at": + "2025-02-14", "hide_collections": false, "noindex": false, "emojis": [], "roles": + [], "fields": [{"name": "wa-", "value": "\ud83e\udd86", "verified_at": null}, + {"name": "wa-", "value": "\ud83e\udd86", "verified_at": null}, {"name": "wa-", + "value": "\ud83e\udd86", "verified_at": null}]}}, {"source": "past_interactions", + "sources": ["friends_of_friends"], "account": {"id": "864725", "username": + "bentosmile", "acct": "bentosmile@slime.global", "display_name": "bentosmile\ud83c\udf71", + "locked": true, "bot": false, "discoverable": true, "indexable": false, "group": + false, "created_at": "2019-07-22T00:00:00.000Z", "note": "

artist/gamedev + on hiatus. nb but it''s complicated. posts veer between silly stuff and serious. + general cws: mh, su, sh, sa. I have a fluffy dog.

main account~!

", + "url": "https://slime.global/@bentosmile", "uri": "https://slime.global/users/bentosmile", + "avatar": "https://files.mastodon.social/cache/accounts/avatars/000/864/725/original/279d5ff334ffd0d3.jpeg", + "avatar_static": "https://files.mastodon.social/cache/accounts/avatars/000/864/725/original/279d5ff334ffd0d3.jpeg", + "header": "https://mastodon.social/headers/original/missing.png", "header_static": + "https://mastodon.social/headers/original/missing.png", "followers_count": + 218, "following_count": 294, "statuses_count": 5414, "last_status_at": "2024-09-01", + "hide_collections": false, "emojis": [], "fields": [{"name": "pronouns from + afar", "value": "they/them", "verified_at": null}, {"name": "pronouns close + up", "value": "any/all", "verified_at": null}]}}, {"source": "past_interactions", + "sources": ["friends_of_friends"], "account": {"id": "112900843174034035", + "username": "kit", "acct": "kit@sharkey.kitredgrave.net", "display_name": + "Kit Redgrave", "locked": true, "bot": false, "discoverable": true, "indexable": + false, "group": false, "created_at": "2024-08-04T00:00:00.000Z", "note": "

frizzy + nerd & creature of the matrix, but sometimes goes outside too

slightly + evil synthetic magical genderfluid cat/coyote/fox thing, she/they

early-mid + 30s

post-gender, post-postfurry, post-america, post-everything

warning: + this is rapidly evolving research software

gnu natalie nguyen, sophia + butler, and all our other late siblings
\ud83d\udd6f\ufe0f

avatar + by
@distressedegg@mellified.men

", + "url": "https://sharkey.kitredgrave.net/@kit", "uri": "https://sharkey.kitredgrave.net/users/9wh9400toazs0001", + "avatar": "https://files.mastodon.social/cache/accounts/avatars/112/900/843/174/034/035/original/5184edf2118cf693.webp", + "avatar_static": "https://files.mastodon.social/cache/accounts/avatars/112/900/843/174/034/035/original/5184edf2118cf693.webp", + "header": "https://mastodon.social/headers/original/missing.png", "header_static": + "https://mastodon.social/headers/original/missing.png", "followers_count": + 36, "following_count": 37, "statuses_count": 381, "last_status_at": "2025-02-14", + "hide_collections": true, "emojis": [], "fields": [{"name": "mtg colors", + "value": "\ud83d\udca7\u2600\ufe0f\ud83c\udf32", "verified_at": null}]}}, + {"source": "past_interactions", "sources": ["friends_of_friends"], "account": + {"id": "183773", "username": "MadestMadness", "acct": "MadestMadness@meow.social", + "display_name": "\ud83d\udda8\ufe0f\ud83e\udd8a\ud83d\udcbbMaddie\ud83d\udcda\ud83e\udd8a\ud83c\udf75", + "locked": true, "bot": false, "discoverable": true, "indexable": false, "group": + false, "created_at": "2017-07-21T00:00:00.000Z", "note": "

I''m Maddie
Tiny + fennec doing fennec things
#Reet + #LGBT #ComputerScience + #FOSS #Emacs + #Linux #Gaming + #Doom #Furry + #FountainPens + #Keyboards #Tea + #3DPrinting \ud83d\ude0a
Reet + \ud83e\udd8a

White

I''m over 18. Minors can follow I guess, but + interacting with my adult posts as a minor is an automatic block.

Taking + follow requests slowly and cautiously.

Please DM me before submitting + a follow request for best results.

", "url": "https://meow.social/@MadestMadness", + "uri": "https://meow.social/users/MadestMadness", "avatar": "https://files.mastodon.social/cache/accounts/avatars/000/183/773/original/8c2ce6bd07dece46.png", + "avatar_static": "https://files.mastodon.social/cache/accounts/avatars/000/183/773/original/8c2ce6bd07dece46.png", + "header": "https://files.mastodon.social/cache/accounts/headers/000/183/773/original/894188646ada8783.png", + "header_static": "https://files.mastodon.social/cache/accounts/headers/000/183/773/original/894188646ada8783.png", + "followers_count": 432, "following_count": 1134, "statuses_count": 38680, + "last_status_at": "2023-07-05", "hide_collections": false, "emojis": [], "fields": + [{"name": "Pronouns", "value": "She / Her (They / Them is fine)", "verified_at": + null}, {"name": "Sexuality", "value": "Bisexual", "verified_at": null}, {"name": + "Alt", "value": "@MadestMadness@plush.city", + "verified_at": null}, {"name": "Jabber / Element / Email", "value": "Ask", + "verified_at": null}]}}, {"source": "global", "sources": ["most_followed", + "most_interactions"], "account": {"id": "16041", "username": "dansup", "acct": + "dansup", "display_name": "Daniel Supernault", "locked": false, "bot": false, + "discoverable": true, "indexable": false, "group": false, "created_at": "2016-11-27T00:00:00.000Z", + "note": "

just a guy from canada building things for the fediverse

", + "url": "https://mastodon.social/@dansup", "uri": "https://mastodon.social/users/dansup", + "avatar": "https://files.mastodon.social/accounts/avatars/000/016/041/original/6db4e4f6ffc0ef84.jpeg", + "avatar_static": "https://files.mastodon.social/accounts/avatars/000/016/041/original/6db4e4f6ffc0ef84.jpeg", + "header": "https://mastodon.social/headers/original/missing.png", "header_static": + "https://mastodon.social/headers/original/missing.png", "followers_count": + 26623, "following_count": 135, "statuses_count": 1218, "last_status_at": "2025-02-14", + "hide_collections": true, "noindex": true, "emojis": [], "roles": [], "fields": + [{"name": "website", "value": "https://dansup.com", "verified_at": + null}]}}, {"source": "global", "sources": ["most_followed", "most_interactions"], + "account": {"id": "109208442152198181", "username": "dangillmor", "acct": + "dangillmor", "display_name": "Dan Gillmor", "locked": false, "bot": false, + "discoverable": true, "indexable": true, "group": false, "created_at": "2022-10-21T00:00:00.000Z", + "note": "

Bio and disclosures: dangillmor.com/about/ Boosts mean I think + you should see this -- usually but not always an endorsement.

California, + Nara \u00b7 dangillmor.com

", "url": "https://mastodon.social/@dangillmor", + "uri": "https://mastodon.social/users/dangillmor", "avatar": "https://files.mastodon.social/accounts/avatars/109/208/442/152/198/181/original/a98930cc33876975.png", + "avatar_static": "https://files.mastodon.social/accounts/avatars/109/208/442/152/198/181/original/a98930cc33876975.png", + "header": "https://files.mastodon.social/accounts/headers/109/208/442/152/198/181/original/5bc6a2cfa0c4164f.jpg", + "header_static": "https://files.mastodon.social/accounts/headers/109/208/442/152/198/181/original/5bc6a2cfa0c4164f.jpg", + "followers_count": 44239, "following_count": 991, "statuses_count": 10476, + "last_status_at": "2025-02-14", "hide_collections": false, "noindex": false, + "emojis": [], "roles": [], "fields": [{"name": "Personal site", "value": "https://dangillmor.com", "verified_at": "2023-03-28T23:34:51.149+00:00"}, + {"name": "Journalists, please leave Twitter and join the fediverse. Here''s + how to get started:", "value": "https://www.techdirt.com/2023/01/04/journalists-and-others-should-leave-twitter-heres-how-they-can-get-started/", + "verified_at": null}, {"name": "\"Cornerstone of Democracy\" Newsletter", + "value": "https://cornerstone.ghost.io", + "verified_at": null}, {"name": "Contact me", "value": "https://dangillmor.com/contact", + "verified_at": "2025-02-12T12:30:11.234+00:00"}]}}, {"source": "past_interactions", + "sources": ["friends_of_friends"], "account": {"id": "52180", "username": + "pzmyers", "acct": "pzmyers@octodon.social", "display_name": "pzmyers \ud83e\udd91", + "locked": false, "bot": false, "discoverable": true, "indexable": true, "group": + false, "created_at": "2017-04-04T00:00:00.000Z", "note": "

Biologist at + the University of Minnesota Morris. Atheist and loud about it. Feminist, the + noisy kind. Antifa. Etc. Preferred pronouns: he/him.

", "url": "https://octodon.social/@pzmyers", + "uri": "https://octodon.social/users/pzmyers", "avatar": "https://files.mastodon.social/accounts/avatars/000/052/180/original/7d6efa84185c5f17.jpeg", + "avatar_static": "https://files.mastodon.social/accounts/avatars/000/052/180/original/7d6efa84185c5f17.jpeg", + "header": "https://mastodon.social/headers/original/missing.png", "header_static": + "https://mastodon.social/headers/original/missing.png", "followers_count": + 6511, "following_count": 1732, "statuses_count": 11503, "last_status_at": + "2025-02-14", "hide_collections": false, "emojis": [], "fields": []}}, {"source": + "past_interactions", "sources": ["similar_to_recently_followed"], "account": + {"id": "110475861154574788", "username": "admin", "acct": "admin@pravda.me", + "display_name": "\u0410\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440", + "locked": false, "bot": false, "discoverable": true, "indexable": false, "group": + false, "created_at": "2022-06-29T00:00:00.000Z", "note": "

\u0410\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f + \u0421\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u0430 PRAVDA social + by Mastodon

", "url": "https://pravda.me/@admin", "uri": "https://pravda.me/users/admin", + "avatar": "https://files.mastodon.social/cache/accounts/avatars/110/475/861/154/574/788/original/7638abd3606085f0.png", + "avatar_static": "https://files.mastodon.social/cache/accounts/avatars/110/475/861/154/574/788/original/7638abd3606085f0.png", + "header": "https://files.mastodon.social/cache/accounts/headers/110/475/861/154/574/788/original/badbcaed74cabfde.png", + "header_static": "https://files.mastodon.social/cache/accounts/headers/110/475/861/154/574/788/original/badbcaed74cabfde.png", + "followers_count": 143620, "following_count": 1, "statuses_count": 0, "last_status_at": + null, "hide_collections": true, "emojis": [], "fields": []}}]' + headers: + Connection: + - keep-alive + Date: + - Fri, 14 Feb 2025 22:38:46 GMT + Strict-Transport-Security: + - max-age=31557600 + Vary: + - Authorization, Origin, Accept-Encoding + X-Cache: + - MISS, MISS, MISS + X-Cache-Hits: + - 0, 0, 0 + X-Served-By: + - cache-fra-eddf8230120-FRA, cache-fra-eddf8230128-FRA, cache-hel1410021-HEL + X-Timer: + - S1739572726.501855,VS0,VE975 + accept-ranges: + - none + alt-svc: + - h3=":443";ma=86400,h3-29=":443";ma=86400,h3-27=":443";ma=86400 + cache-control: + - private, no-store + content-length: + - '90741' + content-security-policy: + - default-src 'none'; frame-ancestors 'none'; form-action 'none' + content-type: + - application/json; charset=utf-8 + etag: + - W/"4d54162a57174887768d2f50cb97f3b7" + referrer-policy: + - same-origin + transfer-encoding: + - chunked + via: + - 1.1 varnish, 1.1 varnish, 1.1 varnish + x-content-type-options: + - nosniff + x-frame-options: + - DENY + x-ratelimit-limit: + - '300' + x-ratelimit-remaining: + - '299' + x-ratelimit-reset: + - '2025-02-14T22:40:00.561240Z' + x-request-id: + - 8c1927163a67ca5e46c4a05b0b73496a + x-runtime: + - '0.922194' + x-xss-protection: + - '0' + status: + code: 200 + message: OK +version: 1 diff --git a/tests/test_entities.py b/tests/test_entities.py new file mode 100644 index 0000000..a262610 --- /dev/null +++ b/tests/test_entities.py @@ -0,0 +1,1402 @@ +import pytest +import vcr +from mastodon.return_types import * +from mastodon.types_base import real_issubclass, Entity +from datetime import datetime, timedelta, timezone + +# "never record anything with admin in the URL" filter +def vcr_filter(request): + # Better to be overly paranoid than the put sensitive data into a git repo + if "admin" in request.path.lower(): + assert False, "Admin functions are not tested by default" + return request + +# Token scrubber +def token_scrubber(response): + # Find any occurrences of the access token and replace it with DUMMY + import json + def zero_out_access_token(body): + if isinstance(body, dict): + for key in body: + if key == "access_token": + body[key] = "DUMMY" + else: + zero_out_access_token(body[key]) + elif isinstance(body, list): + for item in body: + zero_out_access_token(item) + body = json.loads(response["body"]["string"]) + zero_out_access_token(body) + response["body"]["string"] = bytes(json.dumps(body), "utf-8") + return response + +@pytest.mark.vcr( + filter_query_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_post_data_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_headers=[('Authorization', 'DUMMY')], + before_record_request=vcr_filter, + before_record_response=token_scrubber, + match_on=['method', 'uri'], + cassette_library_dir='tests/cassettes_entity_tests' +) +def test_entity_account(mastodon_base, mastodon_admin): + mastodon = mastodon_base + result = mastodon.account(23972) + assert real_issubclass(type(result), Account), str(type(result)) + ' is not a subclass of Account' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), Account), str(type(result)) + ' is not a subclass of Account after to_json/from_json' + result = mastodon.account_verify_credentials() + assert real_issubclass(type(result), Account), str(type(result)) + ' is not a subclass of Account (additional function)' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), Account), str(type(result)) + ' is not a subclass of Account after to_json/from_json (additional function)' + +@pytest.mark.vcr( + filter_query_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_post_data_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_headers=[('Authorization', 'DUMMY')], + before_record_request=vcr_filter, + before_record_response=token_scrubber, + match_on=['method', 'uri'], + cassette_library_dir='tests/cassettes_entity_tests' +) +def test_entity_accountfield(mastodon_base, mastodon_admin): + mastodon = mastodon_base + result = mastodon.account(23972).fields[0] + assert real_issubclass(type(result), AccountField), str(type(result)) + ' is not a subclass of AccountField' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), AccountField), str(type(result)) + ' is not a subclass of AccountField after to_json/from_json' + +@pytest.mark.vcr( + filter_query_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_post_data_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_headers=[('Authorization', 'DUMMY')], + before_record_request=vcr_filter, + before_record_response=token_scrubber, + match_on=['method', 'uri'], + cassette_library_dir='tests/cassettes_entity_tests' +) +def test_entity_role(mastodon_base, mastodon_admin): + mastodon = mastodon_base + result = mastodon.account_verify_credentials().role + assert real_issubclass(type(result), Role), str(type(result)) + ' is not a subclass of Role' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), Role), str(type(result)) + ' is not a subclass of Role after to_json/from_json' + +@pytest.mark.vcr( + filter_query_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_post_data_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_headers=[('Authorization', 'DUMMY')], + before_record_request=vcr_filter, + before_record_response=token_scrubber, + match_on=['method', 'uri'], + cassette_library_dir='tests/cassettes_entity_tests' +) +def test_entity_credentialaccountsource(mastodon_base, mastodon_admin): + mastodon = mastodon_base + result = mastodon.account_verify_credentials()["source"] + assert real_issubclass(type(result), CredentialAccountSource), str(type(result)) + ' is not a subclass of CredentialAccountSource' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), CredentialAccountSource), str(type(result)) + ' is not a subclass of CredentialAccountSource after to_json/from_json' + +@pytest.mark.vcr( + filter_query_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_post_data_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_headers=[('Authorization', 'DUMMY')], + before_record_request=vcr_filter, + before_record_response=token_scrubber, + match_on=['method', 'uri'], + cassette_library_dir='tests/cassettes_entity_tests' +) +def test_entity_status(mastodon_base, mastodon_admin): + mastodon = mastodon_base + result = mastodon.status(110446223051565765) + assert real_issubclass(type(result), Status), str(type(result)) + ' is not a subclass of Status' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), Status), str(type(result)) + ' is not a subclass of Status after to_json/from_json' + result = mastodon.status(110446183735368325) + assert real_issubclass(type(result), Status), str(type(result)) + ' is not a subclass of Status (additional function)' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), Status), str(type(result)) + ' is not a subclass of Status after to_json/from_json (additional function)' + +@pytest.mark.vcr( + filter_query_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_post_data_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_headers=[('Authorization', 'DUMMY')], + before_record_request=vcr_filter, + before_record_response=token_scrubber, + match_on=['method', 'uri'], + cassette_library_dir='tests/cassettes_entity_tests' +) +def test_entity_statusedit(mastodon_base, mastodon_admin): + mastodon = mastodon_base + result = mastodon.status_history(110446223051565765)[-1] + assert real_issubclass(type(result), StatusEdit), str(type(result)) + ' is not a subclass of StatusEdit' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), StatusEdit), str(type(result)) + ' is not a subclass of StatusEdit after to_json/from_json' + result = mastodon.status_history(110446183735368325)[-1] + assert real_issubclass(type(result), StatusEdit), str(type(result)) + ' is not a subclass of StatusEdit (additional function)' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), StatusEdit), str(type(result)) + ' is not a subclass of StatusEdit after to_json/from_json (additional function)' + +@pytest.mark.vcr( + filter_query_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_post_data_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_headers=[('Authorization', 'DUMMY')], + before_record_request=vcr_filter, + before_record_response=token_scrubber, + match_on=['method', 'uri'], + cassette_library_dir='tests/cassettes_entity_tests' +) +def test_entity_filterresult(mastodon_base, mastodon_admin): + mastodon = mastodon_base + result = mastodon.status(110447998920481458).filtered[0] + assert real_issubclass(type(result), FilterResult), str(type(result)) + ' is not a subclass of FilterResult' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), FilterResult), str(type(result)) + ' is not a subclass of FilterResult after to_json/from_json' + +@pytest.mark.vcr( + filter_query_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_post_data_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_headers=[('Authorization', 'DUMMY')], + before_record_request=vcr_filter, + before_record_response=token_scrubber, + match_on=['method', 'uri'], + cassette_library_dir='tests/cassettes_entity_tests' +) +def test_entity_statusmention(mastodon_base, mastodon_admin): + mastodon = mastodon_base + result = mastodon.status(110446223051565765).mentions[0] + assert real_issubclass(type(result), StatusMention), str(type(result)) + ' is not a subclass of StatusMention' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), StatusMention), str(type(result)) + ' is not a subclass of StatusMention after to_json/from_json' + +@pytest.mark.vcr( + filter_query_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_post_data_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_headers=[('Authorization', 'DUMMY')], + before_record_request=vcr_filter, + before_record_response=token_scrubber, + match_on=['method', 'uri'], + cassette_library_dir='tests/cassettes_entity_tests' +) +def test_entity_scheduledstatus(mastodon_base, mastodon_admin): + mastodon = mastodon_base + result = mastodon.status_post("posting in the far future", scheduled_at=datetime(2100,12,12)) + assert real_issubclass(type(result), ScheduledStatus), str(type(result)) + ' is not a subclass of ScheduledStatus' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), ScheduledStatus), str(type(result)) + ' is not a subclass of ScheduledStatus after to_json/from_json' + +@pytest.mark.vcr( + filter_query_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_post_data_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_headers=[('Authorization', 'DUMMY')], + before_record_request=vcr_filter, + before_record_response=token_scrubber, + match_on=['method', 'uri'], + cassette_library_dir='tests/cassettes_entity_tests' +) +def test_entity_scheduledstatusparams(mastodon_base, mastodon_admin): + mastodon = mastodon_base + result = mastodon.status_post("posting in the far future", scheduled_at=datetime(2100,12,12)).params + assert real_issubclass(type(result), ScheduledStatusParams), str(type(result)) + ' is not a subclass of ScheduledStatusParams' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), ScheduledStatusParams), str(type(result)) + ' is not a subclass of ScheduledStatusParams after to_json/from_json' + +@pytest.mark.vcr( + filter_query_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_post_data_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_headers=[('Authorization', 'DUMMY')], + before_record_request=vcr_filter, + before_record_response=token_scrubber, + match_on=['method', 'uri'], + cassette_library_dir='tests/cassettes_entity_tests' +) +def test_entity_poll(mastodon_base, mastodon_admin): + mastodon = mastodon_base + result = mastodon.status(110446383900387196).poll + assert real_issubclass(type(result), Poll), str(type(result)) + ' is not a subclass of Poll' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), Poll), str(type(result)) + ' is not a subclass of Poll after to_json/from_json' + +@pytest.mark.vcr( + filter_query_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_post_data_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_headers=[('Authorization', 'DUMMY')], + before_record_request=vcr_filter, + before_record_response=token_scrubber, + match_on=['method', 'uri'], + cassette_library_dir='tests/cassettes_entity_tests' +) +def test_entity_polloption(mastodon_base, mastodon_admin): + mastodon = mastodon_base + result = mastodon.status(110446383900387196).poll.options[0] + assert real_issubclass(type(result), PollOption), str(type(result)) + ' is not a subclass of PollOption' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), PollOption), str(type(result)) + ' is not a subclass of PollOption after to_json/from_json' + +@pytest.mark.vcr( + filter_query_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_post_data_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_headers=[('Authorization', 'DUMMY')], + before_record_request=vcr_filter, + before_record_response=token_scrubber, + match_on=['method', 'uri'], + cassette_library_dir='tests/cassettes_entity_tests' +) +def test_entity_conversation(mastodon_base, mastodon_admin): + mastodon = mastodon_base + result = mastodon.conversations()[0] + assert real_issubclass(type(result), Conversation), str(type(result)) + ' is not a subclass of Conversation' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), Conversation), str(type(result)) + ' is not a subclass of Conversation after to_json/from_json' + +@pytest.mark.vcr( + filter_query_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_post_data_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_headers=[('Authorization', 'DUMMY')], + before_record_request=vcr_filter, + before_record_response=token_scrubber, + match_on=['method', 'uri'], + cassette_library_dir='tests/cassettes_entity_tests' +) +def test_entity_tag(mastodon_base, mastodon_admin): + mastodon = mastodon_base + result = mastodon.trending_tags()[0] + assert real_issubclass(type(result), Tag), str(type(result)) + ' is not a subclass of Tag' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), Tag), str(type(result)) + ' is not a subclass of Tag after to_json/from_json' + +@pytest.mark.vcr( + filter_query_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_post_data_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_headers=[('Authorization', 'DUMMY')], + before_record_request=vcr_filter, + before_record_response=token_scrubber, + match_on=['method', 'uri'], + cassette_library_dir='tests/cassettes_entity_tests' +) +def test_entity_taghistory(mastodon_base, mastodon_admin): + mastodon = mastodon_base + result = mastodon.trending_tags()[0].history[0] + assert real_issubclass(type(result), TagHistory), str(type(result)) + ' is not a subclass of TagHistory' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), TagHistory), str(type(result)) + ' is not a subclass of TagHistory after to_json/from_json' + +@pytest.mark.vcr( + filter_query_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_post_data_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_headers=[('Authorization', 'DUMMY')], + before_record_request=vcr_filter, + before_record_response=token_scrubber, + match_on=['method', 'uri'], + cassette_library_dir='tests/cassettes_entity_tests' +) +def test_entity_customemoji(mastodon_base, mastodon_admin): + mastodon = mastodon_base + result = mastodon.status(110446223051565765).emojis[0] + assert real_issubclass(type(result), CustomEmoji), str(type(result)) + ' is not a subclass of CustomEmoji' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), CustomEmoji), str(type(result)) + ' is not a subclass of CustomEmoji after to_json/from_json' + +@pytest.mark.vcr( + filter_query_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_post_data_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_headers=[('Authorization', 'DUMMY')], + before_record_request=vcr_filter, + before_record_response=token_scrubber, + match_on=['method', 'uri'], + cassette_library_dir='tests/cassettes_entity_tests' +) +def test_entity_application(mastodon_base, mastodon_admin): + mastodon = mastodon_base + result = mastodon.app_verify_credentials() + assert real_issubclass(type(result), Application), str(type(result)) + ' is not a subclass of Application' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), Application), str(type(result)) + ' is not a subclass of Application after to_json/from_json' + +@pytest.mark.vcr( + filter_query_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_post_data_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_headers=[('Authorization', 'DUMMY')], + before_record_request=vcr_filter, + before_record_response=token_scrubber, + match_on=['method', 'uri'], + cassette_library_dir='tests/cassettes_entity_tests' +) +def test_entity_relationship(mastodon_base, mastodon_admin): + mastodon = mastodon_base + result = mastodon.account_relationships(23972)[0] + assert real_issubclass(type(result), Relationship), str(type(result)) + ' is not a subclass of Relationship' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), Relationship), str(type(result)) + ' is not a subclass of Relationship after to_json/from_json' + +@pytest.mark.vcr( + filter_query_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_post_data_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_headers=[('Authorization', 'DUMMY')], + before_record_request=vcr_filter, + before_record_response=token_scrubber, + match_on=['method', 'uri'], + cassette_library_dir='tests/cassettes_entity_tests' +) +def test_entity_filter(mastodon_base, mastodon_admin): + mastodon = mastodon_base + result = mastodon.filters()[0] + assert real_issubclass(type(result), Filter), str(type(result)) + ' is not a subclass of Filter' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), Filter), str(type(result)) + ' is not a subclass of Filter after to_json/from_json' + +@pytest.mark.vcr( + filter_query_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_post_data_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_headers=[('Authorization', 'DUMMY')], + before_record_request=vcr_filter, + before_record_response=token_scrubber, + match_on=['method', 'uri'], + cassette_library_dir='tests/cassettes_entity_tests' +) +@pytest.mark.skip(reason="FilterV2 is not yet implemented") +def test_entity_filterv2(mastodon_base, mastodon_admin): + mastodon = mastodon_base + result = mastodon.filters()[0] + assert real_issubclass(type(result), FilterV2), str(type(result)) + ' is not a subclass of FilterV2' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), FilterV2), str(type(result)) + ' is not a subclass of FilterV2 after to_json/from_json' + +@pytest.mark.vcr( + filter_query_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_post_data_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_headers=[('Authorization', 'DUMMY')], + before_record_request=vcr_filter, + before_record_response=token_scrubber, + match_on=['method', 'uri'], + cassette_library_dir='tests/cassettes_entity_tests' +) +def test_entity_notification(mastodon_base, mastodon_admin): + mastodon = mastodon_base + result = mastodon.notifications()[0] + assert real_issubclass(type(result), Notification), str(type(result)) + ' is not a subclass of Notification' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), Notification), str(type(result)) + ' is not a subclass of Notification after to_json/from_json' + +@pytest.mark.vcr( + filter_query_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_post_data_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_headers=[('Authorization', 'DUMMY')], + before_record_request=vcr_filter, + before_record_response=token_scrubber, + match_on=['method', 'uri'], + cassette_library_dir='tests/cassettes_entity_tests' +) +def test_entity_context(mastodon_base, mastodon_admin): + mastodon = mastodon_base + result = mastodon.status_context(110446983926957470) + assert real_issubclass(type(result), Context), str(type(result)) + ' is not a subclass of Context' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), Context), str(type(result)) + ' is not a subclass of Context after to_json/from_json' + +@pytest.mark.vcr( + filter_query_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_post_data_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_headers=[('Authorization', 'DUMMY')], + before_record_request=vcr_filter, + before_record_response=token_scrubber, + match_on=['method', 'uri'], + cassette_library_dir='tests/cassettes_entity_tests' +) +def test_entity_userlist(mastodon_base, mastodon_admin): + mastodon = mastodon_base + result = mastodon.lists()[0] + assert real_issubclass(type(result), UserList), str(type(result)) + ' is not a subclass of UserList' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), UserList), str(type(result)) + ' is not a subclass of UserList after to_json/from_json' + +@pytest.mark.vcr( + filter_query_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_post_data_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_headers=[('Authorization', 'DUMMY')], + before_record_request=vcr_filter, + before_record_response=token_scrubber, + match_on=['method', 'uri'], + cassette_library_dir='tests/cassettes_entity_tests' +) +def test_entity_mediaattachment(mastodon_base, mastodon_admin): + mastodon = mastodon_base + result = mastodon.status(110447012773105565).media_attachments[0] + assert real_issubclass(type(result), MediaAttachment), str(type(result)) + ' is not a subclass of MediaAttachment' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), MediaAttachment), str(type(result)) + ' is not a subclass of MediaAttachment after to_json/from_json' + result = mastodon.status(110447003454258227).media_attachments[0] + assert real_issubclass(type(result), MediaAttachment), str(type(result)) + ' is not a subclass of MediaAttachment (additional function)' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), MediaAttachment), str(type(result)) + ' is not a subclass of MediaAttachment after to_json/from_json (additional function)' + +@pytest.mark.vcr( + filter_query_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_post_data_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_headers=[('Authorization', 'DUMMY')], + before_record_request=vcr_filter, + before_record_response=token_scrubber, + match_on=['method', 'uri'], + cassette_library_dir='tests/cassettes_entity_tests' +) +def test_entity_mediaattachmentmetadatacontainer(mastodon_base, mastodon_admin): + mastodon = mastodon_base + result = mastodon.status(110447012773105565).media_attachments[0].meta + assert real_issubclass(type(result), MediaAttachmentMetadataContainer), str(type(result)) + ' is not a subclass of MediaAttachmentMetadataContainer' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), MediaAttachmentMetadataContainer), str(type(result)) + ' is not a subclass of MediaAttachmentMetadataContainer after to_json/from_json' + result = mastodon.status(110447003454258227).media_attachments[0].meta + assert real_issubclass(type(result), MediaAttachmentMetadataContainer), str(type(result)) + ' is not a subclass of MediaAttachmentMetadataContainer (additional function)' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), MediaAttachmentMetadataContainer), str(type(result)) + ' is not a subclass of MediaAttachmentMetadataContainer after to_json/from_json (additional function)' + +@pytest.mark.vcr( + filter_query_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_post_data_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_headers=[('Authorization', 'DUMMY')], + before_record_request=vcr_filter, + before_record_response=token_scrubber, + match_on=['method', 'uri'], + cassette_library_dir='tests/cassettes_entity_tests' +) +def test_entity_mediaattachmentimagemetadata(mastodon_base, mastodon_admin): + mastodon = mastodon_base + result = mastodon.status(110447003454258227).media_attachments[0].meta.original + assert real_issubclass(type(result), MediaAttachmentImageMetadata), str(type(result)) + ' is not a subclass of MediaAttachmentImageMetadata' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), MediaAttachmentImageMetadata), str(type(result)) + ' is not a subclass of MediaAttachmentImageMetadata after to_json/from_json' + +@pytest.mark.vcr( + filter_query_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_post_data_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_headers=[('Authorization', 'DUMMY')], + before_record_request=vcr_filter, + before_record_response=token_scrubber, + match_on=['method', 'uri'], + cassette_library_dir='tests/cassettes_entity_tests' +) +def test_entity_mediaattachmentvideometadata(mastodon_base, mastodon_admin): + mastodon = mastodon_base + result = mastodon.status(110447001287656894).media_attachments[0].meta.original + assert real_issubclass(type(result), MediaAttachmentVideoMetadata), str(type(result)) + ' is not a subclass of MediaAttachmentVideoMetadata' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), MediaAttachmentVideoMetadata), str(type(result)) + ' is not a subclass of MediaAttachmentVideoMetadata after to_json/from_json' + result = mastodon.status(113358687695262945).media_attachments[0].meta.original + assert real_issubclass(type(result), MediaAttachmentVideoMetadata), str(type(result)) + ' is not a subclass of MediaAttachmentVideoMetadata (additional function)' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), MediaAttachmentVideoMetadata), str(type(result)) + ' is not a subclass of MediaAttachmentVideoMetadata after to_json/from_json (additional function)' + +@pytest.mark.vcr( + filter_query_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_post_data_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_headers=[('Authorization', 'DUMMY')], + before_record_request=vcr_filter, + before_record_response=token_scrubber, + match_on=['method', 'uri'], + cassette_library_dir='tests/cassettes_entity_tests' +) +def test_entity_mediaattachmentaudiometadata(mastodon_base, mastodon_admin): + mastodon = mastodon_base + result = mastodon.status(110447012773105565).media_attachments[0].meta.original + assert real_issubclass(type(result), MediaAttachmentAudioMetadata), str(type(result)) + ' is not a subclass of MediaAttachmentAudioMetadata' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), MediaAttachmentAudioMetadata), str(type(result)) + ' is not a subclass of MediaAttachmentAudioMetadata after to_json/from_json' + +@pytest.mark.vcr( + filter_query_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_post_data_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_headers=[('Authorization', 'DUMMY')], + before_record_request=vcr_filter, + before_record_response=token_scrubber, + match_on=['method', 'uri'], + cassette_library_dir='tests/cassettes_entity_tests' +) +def test_entity_mediaattachmentfocuspoint(mastodon_base, mastodon_admin): + mastodon = mastodon_base + result = mastodon.status(110447003454258227).media_attachments[0].meta.focus + assert real_issubclass(type(result), MediaAttachmentFocusPoint), str(type(result)) + ' is not a subclass of MediaAttachmentFocusPoint' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), MediaAttachmentFocusPoint), str(type(result)) + ' is not a subclass of MediaAttachmentFocusPoint after to_json/from_json' + +@pytest.mark.vcr( + filter_query_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_post_data_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_headers=[('Authorization', 'DUMMY')], + before_record_request=vcr_filter, + before_record_response=token_scrubber, + match_on=['method', 'uri'], + cassette_library_dir='tests/cassettes_entity_tests' +) +def test_entity_mediaattachmentcolors(mastodon_base, mastodon_admin): + mastodon = mastodon_base + result = mastodon.status(110447012773105565).media_attachments[0].meta.colors + assert real_issubclass(type(result), MediaAttachmentColors), str(type(result)) + ' is not a subclass of MediaAttachmentColors' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), MediaAttachmentColors), str(type(result)) + ' is not a subclass of MediaAttachmentColors after to_json/from_json' + +@pytest.mark.vcr( + filter_query_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_post_data_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_headers=[('Authorization', 'DUMMY')], + before_record_request=vcr_filter, + before_record_response=token_scrubber, + match_on=['method', 'uri'], + cassette_library_dir='tests/cassettes_entity_tests' +) +def test_entity_previewcard(mastodon_base, mastodon_admin): + mastodon = mastodon_base + result = mastodon.status_card(110447098625216345) + assert real_issubclass(type(result), PreviewCard), str(type(result)) + ' is not a subclass of PreviewCard' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), PreviewCard), str(type(result)) + ' is not a subclass of PreviewCard after to_json/from_json' + +@pytest.mark.vcr( + filter_query_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_post_data_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_headers=[('Authorization', 'DUMMY')], + before_record_request=vcr_filter, + before_record_response=token_scrubber, + match_on=['method', 'uri'], + cassette_library_dir='tests/cassettes_entity_tests' +) +def test_entity_previewcardauthor(mastodon_base, mastodon_admin): + mastodon = mastodon_base + result = mastodon.status_card(113481707975926080).authors[0] + assert real_issubclass(type(result), PreviewCardAuthor), str(type(result)) + ' is not a subclass of PreviewCardAuthor' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), PreviewCardAuthor), str(type(result)) + ' is not a subclass of PreviewCardAuthor after to_json/from_json' + +@pytest.mark.vcr( + filter_query_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_post_data_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_headers=[('Authorization', 'DUMMY')], + before_record_request=vcr_filter, + before_record_response=token_scrubber, + match_on=['method', 'uri'], + cassette_library_dir='tests/cassettes_entity_tests' +) +def test_entity_searchv2(mastodon_base, mastodon_admin): + mastodon = mastodon_base + result = mastodon.search("halcy") + assert real_issubclass(type(result), SearchV2), str(type(result)) + ' is not a subclass of SearchV2' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), SearchV2), str(type(result)) + ' is not a subclass of SearchV2 after to_json/from_json' + +@pytest.mark.vcr( + filter_query_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_post_data_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_headers=[('Authorization', 'DUMMY')], + before_record_request=vcr_filter, + before_record_response=token_scrubber, + match_on=['method', 'uri'], + cassette_library_dir='tests/cassettes_entity_tests' +) +def test_entity_instance(mastodon_base, mastodon_admin): + mastodon = mastodon_base + result = mastodon.instance_v1() + assert real_issubclass(type(result), Instance), str(type(result)) + ' is not a subclass of Instance' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), Instance), str(type(result)) + ' is not a subclass of Instance after to_json/from_json' + +@pytest.mark.vcr( + filter_query_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_post_data_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_headers=[('Authorization', 'DUMMY')], + before_record_request=vcr_filter, + before_record_response=token_scrubber, + match_on=['method', 'uri'], + cassette_library_dir='tests/cassettes_entity_tests' +) +def test_entity_instanceconfiguration(mastodon_base, mastodon_admin): + mastodon = mastodon_base + result = mastodon.instance_v1().configuration + assert real_issubclass(type(result), InstanceConfiguration), str(type(result)) + ' is not a subclass of InstanceConfiguration' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), InstanceConfiguration), str(type(result)) + ' is not a subclass of InstanceConfiguration after to_json/from_json' + +@pytest.mark.vcr( + filter_query_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_post_data_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_headers=[('Authorization', 'DUMMY')], + before_record_request=vcr_filter, + before_record_response=token_scrubber, + match_on=['method', 'uri'], + cassette_library_dir='tests/cassettes_entity_tests' +) +def test_entity_instanceurls(mastodon_base, mastodon_admin): + mastodon = mastodon_base + result = mastodon.instance_v1().urls + assert real_issubclass(type(result), InstanceURLs), str(type(result)) + ' is not a subclass of InstanceURLs' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), InstanceURLs), str(type(result)) + ' is not a subclass of InstanceURLs after to_json/from_json' + result = mastodon.instance_v1().urls + assert real_issubclass(type(result), InstanceURLs), str(type(result)) + ' is not a subclass of InstanceURLs (additional function)' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), InstanceURLs), str(type(result)) + ' is not a subclass of InstanceURLs after to_json/from_json (additional function)' + +@pytest.mark.vcr( + filter_query_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_post_data_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_headers=[('Authorization', 'DUMMY')], + before_record_request=vcr_filter, + before_record_response=token_scrubber, + match_on=['method', 'uri'], + cassette_library_dir='tests/cassettes_entity_tests' +) +def test_entity_instancev2(mastodon_base, mastodon_admin): + mastodon = mastodon_base + result = mastodon.instance_v2() + assert real_issubclass(type(result), InstanceV2), str(type(result)) + ' is not a subclass of InstanceV2' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), InstanceV2), str(type(result)) + ' is not a subclass of InstanceV2 after to_json/from_json' + +@pytest.mark.vcr( + filter_query_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_post_data_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_headers=[('Authorization', 'DUMMY')], + before_record_request=vcr_filter, + before_record_response=token_scrubber, + match_on=['method', 'uri'], + cassette_library_dir='tests/cassettes_entity_tests' +) +def test_entity_instanceicon(mastodon_base, mastodon_admin): + mastodon = mastodon_base + result = mastodon.instance_v2().icon[0] + assert real_issubclass(type(result), InstanceIcon), str(type(result)) + ' is not a subclass of InstanceIcon' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), InstanceIcon), str(type(result)) + ' is not a subclass of InstanceIcon after to_json/from_json' + +@pytest.mark.vcr( + filter_query_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_post_data_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_headers=[('Authorization', 'DUMMY')], + before_record_request=vcr_filter, + before_record_response=token_scrubber, + match_on=['method', 'uri'], + cassette_library_dir='tests/cassettes_entity_tests' +) +def test_entity_instanceconfigurationv2(mastodon_base, mastodon_admin): + mastodon = mastodon_base + result = mastodon.instance_v2().configuration + assert real_issubclass(type(result), InstanceConfigurationV2), str(type(result)) + ' is not a subclass of InstanceConfigurationV2' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), InstanceConfigurationV2), str(type(result)) + ' is not a subclass of InstanceConfigurationV2 after to_json/from_json' + +@pytest.mark.vcr( + filter_query_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_post_data_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_headers=[('Authorization', 'DUMMY')], + before_record_request=vcr_filter, + before_record_response=token_scrubber, + match_on=['method', 'uri'], + cassette_library_dir='tests/cassettes_entity_tests' +) +def test_entity_instancevapidkey(mastodon_base, mastodon_admin): + mastodon = mastodon_base + result = mastodon.instance_v2().configuration.vapid + assert real_issubclass(type(result), InstanceVapidKey), str(type(result)) + ' is not a subclass of InstanceVapidKey' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), InstanceVapidKey), str(type(result)) + ' is not a subclass of InstanceVapidKey after to_json/from_json' + +@pytest.mark.vcr( + filter_query_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_post_data_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_headers=[('Authorization', 'DUMMY')], + before_record_request=vcr_filter, + before_record_response=token_scrubber, + match_on=['method', 'uri'], + cassette_library_dir='tests/cassettes_entity_tests' +) +def test_entity_instanceurlsv2(mastodon_base, mastodon_admin): + mastodon = mastodon_base + result = mastodon.instance_v2().configuration.urls + assert real_issubclass(type(result), InstanceURLsV2), str(type(result)) + ' is not a subclass of InstanceURLsV2' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), InstanceURLsV2), str(type(result)) + ' is not a subclass of InstanceURLsV2 after to_json/from_json' + +@pytest.mark.vcr( + filter_query_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_post_data_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_headers=[('Authorization', 'DUMMY')], + before_record_request=vcr_filter, + before_record_response=token_scrubber, + match_on=['method', 'uri'], + cassette_library_dir='tests/cassettes_entity_tests' +) +def test_entity_instancethumbnail(mastodon_base, mastodon_admin): + mastodon = mastodon_base + result = mastodon.instance().thumbnail + assert real_issubclass(type(result), InstanceThumbnail), str(type(result)) + ' is not a subclass of InstanceThumbnail' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), InstanceThumbnail), str(type(result)) + ' is not a subclass of InstanceThumbnail after to_json/from_json' + +@pytest.mark.vcr( + filter_query_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_post_data_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_headers=[('Authorization', 'DUMMY')], + before_record_request=vcr_filter, + before_record_response=token_scrubber, + match_on=['method', 'uri'], + cassette_library_dir='tests/cassettes_entity_tests' +) +def test_entity_instancethumbnailversions(mastodon_base, mastodon_admin): + mastodon = mastodon_base + result = mastodon.instance().thumbnail.versions + assert real_issubclass(type(result), InstanceThumbnailVersions), str(type(result)) + ' is not a subclass of InstanceThumbnailVersions' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), InstanceThumbnailVersions), str(type(result)) + ' is not a subclass of InstanceThumbnailVersions after to_json/from_json' + +@pytest.mark.vcr( + filter_query_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_post_data_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_headers=[('Authorization', 'DUMMY')], + before_record_request=vcr_filter, + before_record_response=token_scrubber, + match_on=['method', 'uri'], + cassette_library_dir='tests/cassettes_entity_tests' +) +def test_entity_instancestatistics(mastodon_base, mastodon_admin): + mastodon = mastodon_base + result = mastodon.instance_v1().stats + assert real_issubclass(type(result), InstanceStatistics), str(type(result)) + ' is not a subclass of InstanceStatistics' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), InstanceStatistics), str(type(result)) + ' is not a subclass of InstanceStatistics after to_json/from_json' + +@pytest.mark.vcr( + filter_query_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_post_data_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_headers=[('Authorization', 'DUMMY')], + before_record_request=vcr_filter, + before_record_response=token_scrubber, + match_on=['method', 'uri'], + cassette_library_dir='tests/cassettes_entity_tests' +) +def test_entity_instanceusage(mastodon_base, mastodon_admin): + mastodon = mastodon_base + result = mastodon.instance().usage + assert real_issubclass(type(result), InstanceUsage), str(type(result)) + ' is not a subclass of InstanceUsage' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), InstanceUsage), str(type(result)) + ' is not a subclass of InstanceUsage after to_json/from_json' + +@pytest.mark.vcr( + filter_query_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_post_data_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_headers=[('Authorization', 'DUMMY')], + before_record_request=vcr_filter, + before_record_response=token_scrubber, + match_on=['method', 'uri'], + cassette_library_dir='tests/cassettes_entity_tests' +) +def test_entity_instanceusageusers(mastodon_base, mastodon_admin): + mastodon = mastodon_base + result = mastodon.instance().usage.users + assert real_issubclass(type(result), InstanceUsageUsers), str(type(result)) + ' is not a subclass of InstanceUsageUsers' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), InstanceUsageUsers), str(type(result)) + ' is not a subclass of InstanceUsageUsers after to_json/from_json' + +@pytest.mark.vcr( + filter_query_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_post_data_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_headers=[('Authorization', 'DUMMY')], + before_record_request=vcr_filter, + before_record_response=token_scrubber, + match_on=['method', 'uri'], + cassette_library_dir='tests/cassettes_entity_tests' +) +def test_entity_rule(mastodon_base, mastodon_admin): + mastodon = mastodon_base + result = mastodon.instance().rules[0] + assert real_issubclass(type(result), Rule), str(type(result)) + ' is not a subclass of Rule' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), Rule), str(type(result)) + ' is not a subclass of Rule after to_json/from_json' + +@pytest.mark.vcr( + filter_query_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_post_data_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_headers=[('Authorization', 'DUMMY')], + before_record_request=vcr_filter, + before_record_response=token_scrubber, + match_on=['method', 'uri'], + cassette_library_dir='tests/cassettes_entity_tests' +) +def test_entity_instanceregistrations(mastodon_base, mastodon_admin): + mastodon = mastodon_base + result = mastodon.instance_v2().registrations + assert real_issubclass(type(result), InstanceRegistrations), str(type(result)) + ' is not a subclass of InstanceRegistrations' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), InstanceRegistrations), str(type(result)) + ' is not a subclass of InstanceRegistrations after to_json/from_json' + +@pytest.mark.vcr( + filter_query_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_post_data_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_headers=[('Authorization', 'DUMMY')], + before_record_request=vcr_filter, + before_record_response=token_scrubber, + match_on=['method', 'uri'], + cassette_library_dir='tests/cassettes_entity_tests' +) +def test_entity_instancecontact(mastodon_base, mastodon_admin): + mastodon = mastodon_base + result = mastodon.instance().contact + assert real_issubclass(type(result), InstanceContact), str(type(result)) + ' is not a subclass of InstanceContact' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), InstanceContact), str(type(result)) + ' is not a subclass of InstanceContact after to_json/from_json' + +@pytest.mark.vcr( + filter_query_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_post_data_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_headers=[('Authorization', 'DUMMY')], + before_record_request=vcr_filter, + before_record_response=token_scrubber, + match_on=['method', 'uri'], + cassette_library_dir='tests/cassettes_entity_tests' +) +def test_entity_instanceaccountconfiguration(mastodon_base, mastodon_admin): + mastodon = mastodon_base + result = mastodon.instance().configuration.accounts + assert real_issubclass(type(result), InstanceAccountConfiguration), str(type(result)) + ' is not a subclass of InstanceAccountConfiguration' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), InstanceAccountConfiguration), str(type(result)) + ' is not a subclass of InstanceAccountConfiguration after to_json/from_json' + +@pytest.mark.vcr( + filter_query_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_post_data_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_headers=[('Authorization', 'DUMMY')], + before_record_request=vcr_filter, + before_record_response=token_scrubber, + match_on=['method', 'uri'], + cassette_library_dir='tests/cassettes_entity_tests' +) +def test_entity_instancestatusconfiguration(mastodon_base, mastodon_admin): + mastodon = mastodon_base + result = mastodon.instance().configuration.statuses + assert real_issubclass(type(result), InstanceStatusConfiguration), str(type(result)) + ' is not a subclass of InstanceStatusConfiguration' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), InstanceStatusConfiguration), str(type(result)) + ' is not a subclass of InstanceStatusConfiguration after to_json/from_json' + +@pytest.mark.vcr( + filter_query_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_post_data_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_headers=[('Authorization', 'DUMMY')], + before_record_request=vcr_filter, + before_record_response=token_scrubber, + match_on=['method', 'uri'], + cassette_library_dir='tests/cassettes_entity_tests' +) +def test_entity_instancetranslationconfiguration(mastodon_base, mastodon_admin): + mastodon = mastodon_base + result = mastodon.instance_v2().configuration.translation + assert real_issubclass(type(result), InstanceTranslationConfiguration), str(type(result)) + ' is not a subclass of InstanceTranslationConfiguration' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), InstanceTranslationConfiguration), str(type(result)) + ' is not a subclass of InstanceTranslationConfiguration after to_json/from_json' + +@pytest.mark.vcr( + filter_query_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_post_data_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_headers=[('Authorization', 'DUMMY')], + before_record_request=vcr_filter, + before_record_response=token_scrubber, + match_on=['method', 'uri'], + cassette_library_dir='tests/cassettes_entity_tests' +) +def test_entity_instancemediaconfiguration(mastodon_base, mastodon_admin): + mastodon = mastodon_base + result = mastodon.instance().configuration.media_attachments + assert real_issubclass(type(result), InstanceMediaConfiguration), str(type(result)) + ' is not a subclass of InstanceMediaConfiguration' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), InstanceMediaConfiguration), str(type(result)) + ' is not a subclass of InstanceMediaConfiguration after to_json/from_json' + +@pytest.mark.vcr( + filter_query_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_post_data_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_headers=[('Authorization', 'DUMMY')], + before_record_request=vcr_filter, + before_record_response=token_scrubber, + match_on=['method', 'uri'], + cassette_library_dir='tests/cassettes_entity_tests' +) +def test_entity_instancepollconfiguration(mastodon_base, mastodon_admin): + mastodon = mastodon_base + result = mastodon.instance().configuration.polls + assert real_issubclass(type(result), InstancePollConfiguration), str(type(result)) + ' is not a subclass of InstancePollConfiguration' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), InstancePollConfiguration), str(type(result)) + ' is not a subclass of InstancePollConfiguration after to_json/from_json' + +@pytest.mark.vcr( + filter_query_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_post_data_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_headers=[('Authorization', 'DUMMY')], + before_record_request=vcr_filter, + before_record_response=token_scrubber, + match_on=['method', 'uri'], + cassette_library_dir='tests/cassettes_entity_tests' +) +def test_entity_nodeinfo(mastodon_base, mastodon_admin): + mastodon = mastodon_base + result = mastodon.instance_nodeinfo() + assert real_issubclass(type(result), Nodeinfo), str(type(result)) + ' is not a subclass of Nodeinfo' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), Nodeinfo), str(type(result)) + ' is not a subclass of Nodeinfo after to_json/from_json' + +@pytest.mark.vcr( + filter_query_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_post_data_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_headers=[('Authorization', 'DUMMY')], + before_record_request=vcr_filter, + before_record_response=token_scrubber, + match_on=['method', 'uri'], + cassette_library_dir='tests/cassettes_entity_tests' +) +def test_entity_nodeinfosoftware(mastodon_base, mastodon_admin): + mastodon = mastodon_base + result = mastodon.instance_nodeinfo().software + assert real_issubclass(type(result), NodeinfoSoftware), str(type(result)) + ' is not a subclass of NodeinfoSoftware' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), NodeinfoSoftware), str(type(result)) + ' is not a subclass of NodeinfoSoftware after to_json/from_json' + +@pytest.mark.vcr( + filter_query_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_post_data_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_headers=[('Authorization', 'DUMMY')], + before_record_request=vcr_filter, + before_record_response=token_scrubber, + match_on=['method', 'uri'], + cassette_library_dir='tests/cassettes_entity_tests' +) +def test_entity_nodeinfoservices(mastodon_base, mastodon_admin): + mastodon = mastodon_base + result = mastodon.instance_nodeinfo().services + assert real_issubclass(type(result), NodeinfoServices), str(type(result)) + ' is not a subclass of NodeinfoServices' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), NodeinfoServices), str(type(result)) + ' is not a subclass of NodeinfoServices after to_json/from_json' + +@pytest.mark.vcr( + filter_query_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_post_data_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_headers=[('Authorization', 'DUMMY')], + before_record_request=vcr_filter, + before_record_response=token_scrubber, + match_on=['method', 'uri'], + cassette_library_dir='tests/cassettes_entity_tests' +) +def test_entity_nodeinfousage(mastodon_base, mastodon_admin): + mastodon = mastodon_base + result = mastodon.instance_nodeinfo().usage + assert real_issubclass(type(result), NodeinfoUsage), str(type(result)) + ' is not a subclass of NodeinfoUsage' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), NodeinfoUsage), str(type(result)) + ' is not a subclass of NodeinfoUsage after to_json/from_json' + +@pytest.mark.vcr( + filter_query_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_post_data_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_headers=[('Authorization', 'DUMMY')], + before_record_request=vcr_filter, + before_record_response=token_scrubber, + match_on=['method', 'uri'], + cassette_library_dir='tests/cassettes_entity_tests' +) +def test_entity_nodeinfousageusers(mastodon_base, mastodon_admin): + mastodon = mastodon_base + result = mastodon.instance_nodeinfo().usage.users + assert real_issubclass(type(result), NodeinfoUsageUsers), str(type(result)) + ' is not a subclass of NodeinfoUsageUsers' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), NodeinfoUsageUsers), str(type(result)) + ' is not a subclass of NodeinfoUsageUsers after to_json/from_json' + +@pytest.mark.vcr( + filter_query_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_post_data_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_headers=[('Authorization', 'DUMMY')], + before_record_request=vcr_filter, + before_record_response=token_scrubber, + match_on=['method', 'uri'], + cassette_library_dir='tests/cassettes_entity_tests' +) +def test_entity_nodeinfometadata(mastodon_base, mastodon_admin): + mastodon = mastodon_base + result = mastodon.instance_nodeinfo().metadata + assert real_issubclass(type(result), NodeinfoMetadata), str(type(result)) + ' is not a subclass of NodeinfoMetadata' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), NodeinfoMetadata), str(type(result)) + ' is not a subclass of NodeinfoMetadata after to_json/from_json' + +@pytest.mark.vcr( + filter_query_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_post_data_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_headers=[('Authorization', 'DUMMY')], + before_record_request=vcr_filter, + before_record_response=token_scrubber, + match_on=['method', 'uri'], + cassette_library_dir='tests/cassettes_entity_tests' +) +def test_entity_activity(mastodon_base, mastodon_admin): + mastodon = mastodon_base + result = mastodon.instance_activity()[0] + assert real_issubclass(type(result), Activity), str(type(result)) + ' is not a subclass of Activity' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), Activity), str(type(result)) + ' is not a subclass of Activity after to_json/from_json' + +@pytest.mark.skip(reason="Admin functions are not tested by default") +@pytest.mark.vcr( + filter_query_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_post_data_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_headers=[('Authorization', 'DUMMY')], + before_record_request=vcr_filter, + before_record_response=token_scrubber, + match_on=['method', 'uri'], + cassette_library_dir='tests/cassettes_entity_tests' +) +def test_entity_adminreport(mastodon_base, mastodon_admin): + mastodon = mastodon_admin + result = mastodon.admin_reports()[-1] + assert real_issubclass(type(result), AdminReport), str(type(result)) + ' is not a subclass of AdminReport' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), AdminReport), str(type(result)) + ' is not a subclass of AdminReport after to_json/from_json' + result = mastodon.admin_reports(resolved=True)[-1] + assert real_issubclass(type(result), AdminReport), str(type(result)) + ' is not a subclass of AdminReport (additional function)' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), AdminReport), str(type(result)) + ' is not a subclass of AdminReport after to_json/from_json (additional function)' + +@pytest.mark.vcr( + filter_query_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_post_data_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_headers=[('Authorization', 'DUMMY')], + before_record_request=vcr_filter, + before_record_response=token_scrubber, + match_on=['method', 'uri'], + cassette_library_dir='tests/cassettes_entity_tests' +) +def test_entity_webpushsubscription(mastodon_base, mastodon_admin): + mastodon = mastodon_base + result = mastodon.push_subscription_set("http://halcy.de/",mastodon.push_subscription_generate_keys()[1],follow_events=True) + assert real_issubclass(type(result), WebPushSubscription), str(type(result)) + ' is not a subclass of WebPushSubscription' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), WebPushSubscription), str(type(result)) + ' is not a subclass of WebPushSubscription after to_json/from_json' + +@pytest.mark.vcr( + filter_query_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_post_data_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_headers=[('Authorization', 'DUMMY')], + before_record_request=vcr_filter, + before_record_response=token_scrubber, + match_on=['method', 'uri'], + cassette_library_dir='tests/cassettes_entity_tests' +) +def test_entity_webpushsubscriptionalerts(mastodon_base, mastodon_admin): + mastodon = mastodon_base + result = mastodon.push_subscription_set("http://halcy.de/",mastodon.push_subscription_generate_keys()[1],follow_events=True).alerts + assert real_issubclass(type(result), WebPushSubscriptionAlerts), str(type(result)) + ' is not a subclass of WebPushSubscriptionAlerts' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), WebPushSubscriptionAlerts), str(type(result)) + ' is not a subclass of WebPushSubscriptionAlerts after to_json/from_json' + +@pytest.mark.vcr( + filter_query_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_post_data_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_headers=[('Authorization', 'DUMMY')], + before_record_request=vcr_filter, + before_record_response=token_scrubber, + match_on=['method', 'uri'], + cassette_library_dir='tests/cassettes_entity_tests' +) +def test_entity_preferences(mastodon_base, mastodon_admin): + mastodon = mastodon_base + result = mastodon.preferences() + assert real_issubclass(type(result), Preferences), str(type(result)) + ' is not a subclass of Preferences' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), Preferences), str(type(result)) + ' is not a subclass of Preferences after to_json/from_json' + +@pytest.mark.vcr( + filter_query_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_post_data_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_headers=[('Authorization', 'DUMMY')], + before_record_request=vcr_filter, + before_record_response=token_scrubber, + match_on=['method', 'uri'], + cassette_library_dir='tests/cassettes_entity_tests' +) +def test_entity_featuredtag(mastodon_base, mastodon_admin): + mastodon = mastodon_base + result = mastodon.featured_tags()[0] + assert real_issubclass(type(result), FeaturedTag), str(type(result)) + ' is not a subclass of FeaturedTag' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), FeaturedTag), str(type(result)) + ' is not a subclass of FeaturedTag after to_json/from_json' + +@pytest.mark.vcr( + filter_query_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_post_data_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_headers=[('Authorization', 'DUMMY')], + before_record_request=vcr_filter, + before_record_response=token_scrubber, + match_on=['method', 'uri'], + cassette_library_dir='tests/cassettes_entity_tests' +) +def test_entity_marker(mastodon_base, mastodon_admin): + mastodon = mastodon_base + result = mastodon.markers_get()["home"] + assert real_issubclass(type(result), Marker), str(type(result)) + ' is not a subclass of Marker' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), Marker), str(type(result)) + ' is not a subclass of Marker after to_json/from_json' + +@pytest.mark.vcr( + filter_query_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_post_data_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_headers=[('Authorization', 'DUMMY')], + before_record_request=vcr_filter, + before_record_response=token_scrubber, + match_on=['method', 'uri'], + cassette_library_dir='tests/cassettes_entity_tests' +) +def test_entity_announcement(mastodon_base, mastodon_admin): + mastodon = mastodon_admin + result = mastodon.announcements()[0] + assert real_issubclass(type(result), Announcement), str(type(result)) + ' is not a subclass of Announcement' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), Announcement), str(type(result)) + ' is not a subclass of Announcement after to_json/from_json' + +@pytest.mark.vcr( + filter_query_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_post_data_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_headers=[('Authorization', 'DUMMY')], + before_record_request=vcr_filter, + before_record_response=token_scrubber, + match_on=['method', 'uri'], + cassette_library_dir='tests/cassettes_entity_tests' +) +def test_entity_reaction(mastodon_base, mastodon_admin): + mastodon = mastodon_admin + result = mastodon.announcements()[0].reactions[0] + assert real_issubclass(type(result), Reaction), str(type(result)) + ' is not a subclass of Reaction' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), Reaction), str(type(result)) + ' is not a subclass of Reaction after to_json/from_json' + +@pytest.mark.vcr( + filter_query_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_post_data_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_headers=[('Authorization', 'DUMMY')], + before_record_request=vcr_filter, + before_record_response=token_scrubber, + match_on=['method', 'uri'], + cassette_library_dir='tests/cassettes_entity_tests' +) +def test_entity_familiarfollowers(mastodon_base, mastodon_admin): + mastodon = mastodon_admin + result = mastodon.account_familiar_followers(2)[0] + assert real_issubclass(type(result), FamiliarFollowers), str(type(result)) + ' is not a subclass of FamiliarFollowers' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), FamiliarFollowers), str(type(result)) + ' is not a subclass of FamiliarFollowers after to_json/from_json' + +@pytest.mark.skip(reason="Admin functions are not tested by default") +@pytest.mark.vcr( + filter_query_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_post_data_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_headers=[('Authorization', 'DUMMY')], + before_record_request=vcr_filter, + before_record_response=token_scrubber, + match_on=['method', 'uri'], + cassette_library_dir='tests/cassettes_entity_tests' +) +def test_entity_adminaccount(mastodon_base, mastodon_admin): + mastodon = mastodon_admin + result = mastodon.admin_account(1) + assert real_issubclass(type(result), AdminAccount), str(type(result)) + ' is not a subclass of AdminAccount' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), AdminAccount), str(type(result)) + ' is not a subclass of AdminAccount after to_json/from_json' + +@pytest.mark.skip(reason="Admin functions are not tested by default") +@pytest.mark.vcr( + filter_query_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_post_data_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_headers=[('Authorization', 'DUMMY')], + before_record_request=vcr_filter, + before_record_response=token_scrubber, + match_on=['method', 'uri'], + cassette_library_dir='tests/cassettes_entity_tests' +) +def test_entity_adminip(mastodon_base, mastodon_admin): + mastodon = mastodon_admin + result = mastodon.admin_account(1).ips[0] + assert real_issubclass(type(result), AdminIp), str(type(result)) + ' is not a subclass of AdminIp' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), AdminIp), str(type(result)) + ' is not a subclass of AdminIp after to_json/from_json' + +@pytest.mark.skip(reason="Admin functions are not tested by default") +@pytest.mark.vcr( + filter_query_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_post_data_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_headers=[('Authorization', 'DUMMY')], + before_record_request=vcr_filter, + before_record_response=token_scrubber, + match_on=['method', 'uri'], + cassette_library_dir='tests/cassettes_entity_tests' +) +def test_entity_adminmeasure(mastodon_base, mastodon_admin): + mastodon = mastodon_admin + result = mastodon.admin_measures(datetime.now() - timedelta(hours=24*5), datetime.now(), interactions=True)[0] + assert real_issubclass(type(result), AdminMeasure), str(type(result)) + ' is not a subclass of AdminMeasure' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), AdminMeasure), str(type(result)) + ' is not a subclass of AdminMeasure after to_json/from_json' + +@pytest.mark.skip(reason="Admin functions are not tested by default") +@pytest.mark.vcr( + filter_query_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_post_data_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_headers=[('Authorization', 'DUMMY')], + before_record_request=vcr_filter, + before_record_response=token_scrubber, + match_on=['method', 'uri'], + cassette_library_dir='tests/cassettes_entity_tests' +) +def test_entity_adminmeasuredata(mastodon_base, mastodon_admin): + mastodon = mastodon_admin + result = mastodon.admin_measures(datetime.now() - timedelta(hours=24*5), datetime.now(), active_users=True)[0].data[0] + assert real_issubclass(type(result), AdminMeasureData), str(type(result)) + ' is not a subclass of AdminMeasureData' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), AdminMeasureData), str(type(result)) + ' is not a subclass of AdminMeasureData after to_json/from_json' + +@pytest.mark.skip(reason="Admin functions are not tested by default") +@pytest.mark.vcr( + filter_query_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_post_data_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_headers=[('Authorization', 'DUMMY')], + before_record_request=vcr_filter, + before_record_response=token_scrubber, + match_on=['method', 'uri'], + cassette_library_dir='tests/cassettes_entity_tests' +) +def test_entity_admindimension(mastodon_base, mastodon_admin): + mastodon = mastodon_admin + result = mastodon.admin_dimensions(datetime.now() - timedelta(hours=24*5), datetime.now(), languages=True)[0] + assert real_issubclass(type(result), AdminDimension), str(type(result)) + ' is not a subclass of AdminDimension' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), AdminDimension), str(type(result)) + ' is not a subclass of AdminDimension after to_json/from_json' + +@pytest.mark.skip(reason="Admin functions are not tested by default") +@pytest.mark.vcr( + filter_query_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_post_data_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_headers=[('Authorization', 'DUMMY')], + before_record_request=vcr_filter, + before_record_response=token_scrubber, + match_on=['method', 'uri'], + cassette_library_dir='tests/cassettes_entity_tests' +) +def test_entity_admindimensiondata(mastodon_base, mastodon_admin): + mastodon = mastodon_admin + result = mastodon.admin_dimensions(datetime.now() - timedelta(hours=24*5), datetime.now(), languages=True)[0].data[0] + assert real_issubclass(type(result), AdminDimensionData), str(type(result)) + ' is not a subclass of AdminDimensionData' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), AdminDimensionData), str(type(result)) + ' is not a subclass of AdminDimensionData after to_json/from_json' + +@pytest.mark.skip(reason="Admin functions are not tested by default") +@pytest.mark.vcr( + filter_query_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_post_data_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_headers=[('Authorization', 'DUMMY')], + before_record_request=vcr_filter, + before_record_response=token_scrubber, + match_on=['method', 'uri'], + cassette_library_dir='tests/cassettes_entity_tests' +) +def test_entity_adminretention(mastodon_base, mastodon_admin): + mastodon = mastodon_admin + result = mastodon.admin_retention(datetime.now() - timedelta(hours=24*5), datetime.now())[0] + assert real_issubclass(type(result), AdminRetention), str(type(result)) + ' is not a subclass of AdminRetention' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), AdminRetention), str(type(result)) + ' is not a subclass of AdminRetention after to_json/from_json' + +@pytest.mark.skip(reason="Admin functions are not tested by default") +@pytest.mark.vcr( + filter_query_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_post_data_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_headers=[('Authorization', 'DUMMY')], + before_record_request=vcr_filter, + before_record_response=token_scrubber, + match_on=['method', 'uri'], + cassette_library_dir='tests/cassettes_entity_tests' +) +def test_entity_admincohort(mastodon_base, mastodon_admin): + mastodon = mastodon_admin + result = mastodon.admin_retention(datetime.now() - timedelta(hours=24*5), datetime.now())[0].data[0] + assert real_issubclass(type(result), AdminCohort), str(type(result)) + ' is not a subclass of AdminCohort' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), AdminCohort), str(type(result)) + ' is not a subclass of AdminCohort after to_json/from_json' + +@pytest.mark.skip(reason="Admin functions are not tested by default") +@pytest.mark.vcr( + filter_query_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_post_data_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_headers=[('Authorization', 'DUMMY')], + before_record_request=vcr_filter, + before_record_response=token_scrubber, + match_on=['method', 'uri'], + cassette_library_dir='tests/cassettes_entity_tests' +) +def test_entity_admindomainblock(mastodon_base, mastodon_admin): + mastodon = mastodon_admin + result = mastodon.admin_domain_blocks()[0] + assert real_issubclass(type(result), AdminDomainBlock), str(type(result)) + ' is not a subclass of AdminDomainBlock' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), AdminDomainBlock), str(type(result)) + ' is not a subclass of AdminDomainBlock after to_json/from_json' + +@pytest.mark.vcr( + filter_query_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_post_data_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_headers=[('Authorization', 'DUMMY')], + before_record_request=vcr_filter, + before_record_response=token_scrubber, + match_on=['method', 'uri'], + cassette_library_dir='tests/cassettes_entity_tests' +) +def test_entity_suggestion(mastodon_base, mastodon_admin): + mastodon = mastodon_base + result = mastodon.suggestions_v2()[0] + assert real_issubclass(type(result), Suggestion), str(type(result)) + ' is not a subclass of Suggestion' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), Suggestion), str(type(result)) + ' is not a subclass of Suggestion after to_json/from_json' + +@pytest.mark.vcr( + filter_query_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_post_data_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_headers=[('Authorization', 'DUMMY')], + before_record_request=vcr_filter, + before_record_response=token_scrubber, + match_on=['method', 'uri'], + cassette_library_dir='tests/cassettes_entity_tests' +) +def test_entity_accountcreationerror(mastodon_base, mastodon_admin): + mastodon = mastodon_base + result = mastodon.create_account('halcy', 'secret', 'invalid email lol', True, return_detailed_error=True)[1] + assert real_issubclass(type(result), AccountCreationError), str(type(result)) + ' is not a subclass of AccountCreationError' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), AccountCreationError), str(type(result)) + ' is not a subclass of AccountCreationError after to_json/from_json' + +@pytest.mark.vcr( + filter_query_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_post_data_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_headers=[('Authorization', 'DUMMY')], + before_record_request=vcr_filter, + before_record_response=token_scrubber, + match_on=['method', 'uri'], + cassette_library_dir='tests/cassettes_entity_tests' +) +def test_entity_accountcreationerrordetails(mastodon_base, mastodon_admin): + mastodon = mastodon_base + result = mastodon.create_account('halcy', 'secret', 'invalid email lol', False, return_detailed_error=True)[1].details + assert real_issubclass(type(result), AccountCreationErrorDetails), str(type(result)) + ' is not a subclass of AccountCreationErrorDetails' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), AccountCreationErrorDetails), str(type(result)) + ' is not a subclass of AccountCreationErrorDetails after to_json/from_json' + +@pytest.mark.vcr( + filter_query_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_post_data_parameters=[('access_token', 'DUMMY'), ('client_id', 'DUMMY'), ('client_secret', 'DUMMY')], + filter_headers=[('Authorization', 'DUMMY')], + before_record_request=vcr_filter, + before_record_response=token_scrubber, + match_on=['method', 'uri'], + cassette_library_dir='tests/cassettes_entity_tests' +) +def test_entity_accountcreationerrordetailsfield(mastodon_base, mastodon_admin): + mastodon = mastodon_base + result = mastodon.create_account('halcy', 'secret', 'invalid email lol', True, return_detailed_error=True)[1].details.email[0] + assert real_issubclass(type(result), AccountCreationErrorDetailsField), str(type(result)) + ' is not a subclass of AccountCreationErrorDetailsField' + result = Entity.from_json(result.to_json()) + assert real_issubclass(type(result), AccountCreationErrorDetailsField), str(type(result)) + ' is not a subclass of AccountCreationErrorDetailsField after to_json/from_json'