diff options
author | halcy <halcy@ARARAGI-KUN> | 2022-11-28 00:55:41 +0200 |
---|---|---|
committer | halcy <halcy@ARARAGI-KUN> | 2022-11-28 00:55:41 +0200 |
commit | dbceccb210d401887002abf0ea3c746260423f1f (patch) | |
tree | ecb48bbd819441c4838312556becf23e4fdea3b2 | |
parent | ae9f7640878e3f402b4f8784cecadf5aab0d5d7c (diff) | |
download | mastodon.py-dbceccb210d401887002abf0ea3c746260423f1f.tar.gz |
Add v2 admin accounts API
-rw-r--r-- | CHANGELOG.rst | 2 | ||||
-rw-r--r-- | TODO.md | 2 | ||||
-rw-r--r-- | docs/index.rst | 2 | ||||
-rw-r--r-- | mastodon/Mastodon.py | 88 | ||||
-rw-r--r-- | tests/cassettes/test_admin_accounts_v1.yaml | 179 | ||||
-rw-r--r-- | tests/cassettes/test_admin_accounts_v2.yaml | 237 | ||||
-rw-r--r-- | tests/test_admin.py | 38 | ||||
-rw-r--r-- | tests/test_constructor.py | 11 |
8 files changed, 548 insertions, 11 deletions
diff --git a/CHANGELOG.rst b/CHANGELOG.rst index c6d7c91..d83513c 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst | |||
@@ -17,6 +17,8 @@ v1.8.0 (in progress) | |||
17 | * Added client auth data to access token file. | 17 | * Added client auth data to access token file. |
18 | * Added `account_familiar_followers` API | 18 | * Added `account_familiar_followers` API |
19 | * Added `account_remove_from_followers` API | 19 | * Added `account_remove_from_followers` API |
20 | * Added `admin_accounts_v2` API | ||
21 | * FUTURE BREAKING CHANGE WARNING: For now, `admin_accounts` still calls v1, but this may change in the future. You are encouraged to use v2 instead. | ||
20 | 22 | ||
21 | v1.7.0 | 23 | v1.7.0 |
22 | ------ | 24 | ------ |
@@ -51,7 +51,7 @@ Refer to mastodon changelog and API docs for details when implementing, add or m | |||
51 | * [x] Add global lang param to REST API | 51 | * [x] Add global lang param to REST API |
52 | * [x] Add types param to GET /api/v1/notifications in REST API | 52 | * [x] Add types param to GET /api/v1/notifications in REST API |
53 | * [x] Add notifications for moderators about new sign-ups | 53 | * [x] Add notifications for moderators about new sign-ups |
54 | * [ ] v2 admin account api | 54 | * [x] v2 admin account api |
55 | 55 | ||
56 | 3.5.3 | 56 | 3.5.3 |
57 | ----- | 57 | ----- |
diff --git a/docs/index.rst b/docs/index.rst index f44ee55..5103b0b 100644 --- a/docs/index.rst +++ b/docs/index.rst | |||
@@ -1504,7 +1504,9 @@ EXTREME CARE. | |||
1504 | This is not to say that you should not treat access tokens from admin accounts that do not | 1504 | This is not to say that you should not treat access tokens from admin accounts that do not |
1505 | have admin: scopes attached with a lot of care, but be extra careful with those that do. | 1505 | have admin: scopes attached with a lot of care, but be extra careful with those that do. |
1506 | 1506 | ||
1507 | .. automethod:: Mastodon.admin_accounts_v2 | ||
1507 | .. automethod:: Mastodon.admin_accounts | 1508 | .. automethod:: Mastodon.admin_accounts |
1509 | .. automethod:: Mastodon.admin_accounts_v1 | ||
1508 | .. automethod:: Mastodon.admin_account | 1510 | .. automethod:: Mastodon.admin_account |
1509 | .. automethod:: Mastodon.admin_account_enable | 1511 | .. automethod:: Mastodon.admin_account_enable |
1510 | .. automethod:: Mastodon.admin_account_approve | 1512 | .. automethod:: Mastodon.admin_account_approve |
diff --git a/mastodon/Mastodon.py b/mastodon/Mastodon.py index 2adcd74..895fa36 100644 --- a/mastodon/Mastodon.py +++ b/mastodon/Mastodon.py | |||
@@ -255,7 +255,7 @@ class Mastodon: | |||
255 | __DICT_VERSION_CONVERSATION = bigger_version(bigger_version("2.6.0", __DICT_VERSION_ACCOUNT), __DICT_VERSION_STATUS) | 255 | __DICT_VERSION_CONVERSATION = bigger_version(bigger_version("2.6.0", __DICT_VERSION_ACCOUNT), __DICT_VERSION_STATUS) |
256 | __DICT_VERSION_SCHEDULED_STATUS = bigger_version("2.7.0", __DICT_VERSION_STATUS) | 256 | __DICT_VERSION_SCHEDULED_STATUS = bigger_version("2.7.0", __DICT_VERSION_STATUS) |
257 | __DICT_VERSION_PREFERENCES = "2.8.0" | 257 | __DICT_VERSION_PREFERENCES = "2.8.0" |
258 | __DICT_VERSION_ADMIN_ACCOUNT = bigger_version("2.9.1", __DICT_VERSION_ACCOUNT) | 258 | __DICT_VERSION_ADMIN_ACCOUNT = bigger_version("4.0.0", __DICT_VERSION_ACCOUNT) |
259 | __DICT_VERSION_FEATURED_TAG = "3.0.0" | 259 | __DICT_VERSION_FEATURED_TAG = "3.0.0" |
260 | __DICT_VERSION_MARKER = "3.0.0" | 260 | __DICT_VERSION_MARKER = "3.0.0" |
261 | __DICT_VERSION_REACTION = "3.1.0" | 261 | __DICT_VERSION_REACTION = "3.1.0" |
@@ -666,8 +666,7 @@ class Mastodon: | |||
666 | received_scopes += self.__SCOPE_SETS[scope_set] | 666 | received_scopes += self.__SCOPE_SETS[scope_set] |
667 | 667 | ||
668 | if not set(scopes) <= set(received_scopes): | 668 | if not set(scopes) <= set(received_scopes): |
669 | raise MastodonAPIError( | 669 | raise MastodonAPIError('Granted scopes "' + " ".join(received_scopes) + '" do not contain all of the requested scopes "' + " ".join(scopes) + '".') |
670 | 'Granted scopes "' + " ".join(received_scopes) + '" do not contain all of the requested scopes "' + " ".join(scopes) + '".') | ||
671 | 670 | ||
672 | if to_file is not None: | 671 | if to_file is not None: |
673 | with open(to_file, 'w') as token_file: | 672 | with open(to_file, 'w') as token_file: |
@@ -3130,9 +3129,81 @@ class Mastodon: | |||
3130 | ### | 3129 | ### |
3131 | # Moderation API | 3130 | # Moderation API |
3132 | ### | 3131 | ### |
3132 | @api_version("2.9.1", "4.0.0", __DICT_VERSION_ADMIN_ACCOUNT) | ||
3133 | def admin_accounts_v2(self, origin=None, by_domain=None, status=None, username=None, display_name=None, email=None, ip=None, | ||
3134 | permissions=None, invited_by=None, role_ids=None, max_id=None, min_id=None, since_id=None, limit=None): | ||
3135 | """ | ||
3136 | Fetches a list of accounts that match given criteria. By default, local accounts are returned. | ||
3137 | |||
3138 | * Set `origin` to "local" or "remote" to get only local or remote accounts. | ||
3139 | * Set `by_domain` to a domain to get only accounts from that domain. | ||
3140 | * Set `status` to one of "active", "pending", "disabled", "silenced" or "suspended" to get only accounts with that moderation status (default: active) | ||
3141 | * Set `username` to a string to get only accounts whose username contains this string. | ||
3142 | * Set `display_name` to a string to get only accounts whose display name contains this string. | ||
3143 | * Set `email` to an email to get only accounts with that email (this only works on local accounts). | ||
3144 | * Set `ip` to an ip (as a string, standard v4/v6 notation) to get only accounts whose last active ip is that ip (this only works on local accounts). | ||
3145 | * Set `permissions` to "staff" to only get accounts with staff permissions. | ||
3146 | * Set `invited_by` to an account id to get only accounts invited by this user. | ||
3147 | * Set `role_ids` to a list of role IDs to get only accounts with those roles. | ||
3148 | |||
3149 | Returns a list of `admin account dicts`_. | ||
3150 | """ | ||
3151 | if max_id is not None: | ||
3152 | max_id = self.__unpack_id(max_id, dateconv=True) | ||
3153 | |||
3154 | if min_id is not None: | ||
3155 | min_id = self.__unpack_id(min_id, dateconv=True) | ||
3156 | |||
3157 | if since_id is not None: | ||
3158 | since_id = self.__unpack_id(since_id, dateconv=True) | ||
3159 | |||
3160 | if role_ids is not None: | ||
3161 | if not isinstance(role_ids, list): | ||
3162 | role_ids = [role_ids] | ||
3163 | role_ids = list(map(self.__unpack_id, role_ids)) | ||
3164 | |||
3165 | if invited_by is not None: | ||
3166 | invited_by = self.__unpack_id(invited_by) | ||
3167 | |||
3168 | if permissions is not None and not permissions in ["staff"]: | ||
3169 | raise MastodonIllegalArgumentError("Permissions must be staff if passed") | ||
3170 | |||
3171 | if origin is not None and not origin in ["local", "remote"]: | ||
3172 | raise MastodonIllegalArgumentError("Origin must be local or remote") | ||
3173 | |||
3174 | if status is not None and not status in ["active", "pending", "disabled", "silenced", "suspended"]: | ||
3175 | raise MastodonIllegalArgumentError("Status must be local or active, pending, disabled, silenced or suspended") | ||
3176 | |||
3177 | if not by_domain is None: | ||
3178 | by_domain = self.__deprotocolize(by_domain) | ||
3179 | |||
3180 | params = self.__generate_params(locals()) | ||
3181 | return self.__api_request('GET', '/api/v2/admin/accounts', params) | ||
3182 | |||
3133 | @api_version("2.9.1", "2.9.1", __DICT_VERSION_ADMIN_ACCOUNT) | 3183 | @api_version("2.9.1", "2.9.1", __DICT_VERSION_ADMIN_ACCOUNT) |
3134 | def admin_accounts(self, remote=False, by_domain=None, status='active', username=None, display_name=None, email=None, ip=None, staff_only=False, max_id=None, min_id=None, since_id=None, limit=None): | 3184 | def admin_accounts(self, remote=False, by_domain=None, status='active', username=None, display_name=None, email=None, ip=None, staff_only=False, max_id=None, min_id=None, since_id=None, limit=None): |
3135 | """ | 3185 | """ |
3186 | Currently a synonym for admin_accounts_v1, now deprecated. You are strongly encouraged to use admin_accounts_v2 instead, since this one is kind of bad. | ||
3187 | |||
3188 | !!!!! This function may be switched to calling the v2 API in the future. This is your warning. If you want to keep using v1, use it explicitly. !!!!! | ||
3189 | """ | ||
3190 | return self.admin_accounts_v1( | ||
3191 | remote=remote, | ||
3192 | by_domain=by_domain, | ||
3193 | status=status, | ||
3194 | username=username, | ||
3195 | display_name=display_name, | ||
3196 | email=email, | ||
3197 | ip=ip, | ||
3198 | staff_only=staff_only, | ||
3199 | max_id=max_id, | ||
3200 | min_id=min_id, | ||
3201 | since_id=since_id | ||
3202 | ) | ||
3203 | |||
3204 | @api_version("2.9.1", "2.9.1", __DICT_VERSION_ADMIN_ACCOUNT) | ||
3205 | def admin_accounts_v1(self, remote=False, by_domain=None, status='active', username=None, display_name=None, email=None, ip=None, staff_only=False, max_id=None, min_id=None, since_id=None, limit=None): | ||
3206 | """ | ||
3136 | Fetches a list of accounts that match given criteria. By default, local accounts are returned. | 3207 | Fetches a list of accounts that match given criteria. By default, local accounts are returned. |
3137 | 3208 | ||
3138 | * Set `remote` to True to get remote accounts, otherwise local accounts are returned (default: local accounts) | 3209 | * Set `remote` to True to get remote accounts, otherwise local accounts are returned (default: local accounts) |
@@ -3147,6 +3218,8 @@ class Mastodon: | |||
3147 | Note that setting the boolean parameters to False does not mean "give me users to which this does not apply" but | 3218 | Note that setting the boolean parameters to False does not mean "give me users to which this does not apply" but |
3148 | instead means "I do not care if users have this attribute". | 3219 | instead means "I do not care if users have this attribute". |
3149 | 3220 | ||
3221 | Deprecated in Mastodon version 3.5.0. | ||
3222 | |||
3150 | Returns a list of `admin account dicts`_. | 3223 | Returns a list of `admin account dicts`_. |
3151 | """ | 3224 | """ |
3152 | if max_id is not None: | 3225 | if max_id is not None: |
@@ -3158,14 +3231,12 @@ class Mastodon: | |||
3158 | if since_id is not None: | 3231 | if since_id is not None: |
3159 | since_id = self.__unpack_id(since_id, dateconv=True) | 3232 | since_id = self.__unpack_id(since_id, dateconv=True) |
3160 | 3233 | ||
3161 | params = self.__generate_params( | 3234 | params = self.__generate_params(locals(), ['remote', 'status', 'staff_only']) |
3162 | locals(), ['remote', 'status', 'staff_only']) | ||
3163 | 3235 | ||
3164 | if remote: | 3236 | if remote: |
3165 | params["remote"] = True | 3237 | params["remote"] = True |
3166 | 3238 | ||
3167 | mod_statuses = ["active", "pending", | 3239 | mod_statuses = ["active", "pending", "disabled", "silenced", "suspended"] |
3168 | "disabled", "silenced", "suspended"] | ||
3169 | if not status in mod_statuses: | 3240 | if not status in mod_statuses: |
3170 | raise ValueError("Invalid moderation status requested.") | 3241 | raise ValueError("Invalid moderation status requested.") |
3171 | 3242 | ||
@@ -3176,6 +3247,9 @@ class Mastodon: | |||
3176 | if status == mod_status: | 3247 | if status == mod_status: |
3177 | params[status] = True | 3248 | params[status] = True |
3178 | 3249 | ||
3250 | if not by_domain is None: | ||
3251 | by_domain = self.__deprotocolize(by_domain) | ||
3252 | |||
3179 | return self.__api_request('GET', '/api/v1/admin/accounts', params) | 3253 | return self.__api_request('GET', '/api/v1/admin/accounts', params) |
3180 | 3254 | ||
3181 | @api_version("2.9.1", "2.9.1", __DICT_VERSION_ADMIN_ACCOUNT) | 3255 | @api_version("2.9.1", "2.9.1", __DICT_VERSION_ADMIN_ACCOUNT) |
diff --git a/tests/cassettes/test_admin_accounts_v1.yaml b/tests/cassettes/test_admin_accounts_v1.yaml new file mode 100644 index 0000000..0c9b187 --- /dev/null +++ b/tests/cassettes/test_admin_accounts_v1.yaml | |||
@@ -0,0 +1,179 @@ | |||
1 | interactions: | ||
2 | - request: | ||
3 | body: null | ||
4 | headers: | ||
5 | Accept: | ||
6 | - '*/*' | ||
7 | Accept-Encoding: | ||
8 | - gzip, deflate | ||
9 | Authorization: | ||
10 | - Bearer __MASTODON_PY_TEST_ACCESS_TOKEN_2 | ||
11 | Connection: | ||
12 | - keep-alive | ||
13 | User-Agent: | ||
14 | - tests/v311 | ||
15 | method: GET | ||
16 | uri: http://localhost:3000/api/v1/admin/accounts?active=True | ||
17 | response: | ||
18 | body: | ||
19 | string: '[{"id":"109411886050231694","username":"mastodonpy_test_2","domain":null,"created_at":"2022-11-26T20:01:30.195Z","email":"mastodonpy_test_2@localhost:3000","ip":null,"role":{"id":-99,"name":"","color":"","position":-1,"permissions":65536,"highlighted":false,"created_at":"2022-11-26T20:01:24.328Z","updated_at":"2022-11-26T20:01:24.328Z"},"confirmed":true,"suspended":false,"silenced":false,"sensitized":false,"disabled":false,"approved":true,"locale":"ja","invite_request":null,"ips":[],"account":{"id":"109411886050231694","username":"mastodonpy_test_2","acct":"mastodonpy_test_2","display_name":"","locked":false,"bot":false,"discoverable":true,"group":false,"created_at":"2022-11-26T00:00:00.000Z","note":"","url":"http://localhost:3000/@mastodonpy_test_2","avatar":"http://localhost:3000/avatars/original/missing.png","avatar_static":"http://localhost:3000/avatars/original/missing.png","header":"http://localhost:3000/headers/original/missing.png","header_static":"http://localhost:3000/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":0,"last_status_at":null,"noindex":false,"emojis":[],"fields":[]}},{"id":"109411885927532888","username":"mastodonpy_test","domain":null,"created_at":"2022-11-26T20:01:28.322Z","email":"mastodonpy_test@localhost:3000","ip":null,"role":{"id":-99,"name":"","color":"","position":-1,"permissions":65536,"highlighted":false,"created_at":"2022-11-26T20:01:24.328Z","updated_at":"2022-11-26T20:01:24.328Z"},"confirmed":true,"suspended":false,"silenced":false,"sensitized":false,"disabled":false,"approved":true,"locale":"ja","invite_request":null,"ips":[],"account":{"id":"109411885927532888","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":true,"bot":false,"discoverable":null,"group":false,"created_at":"2022-11-26T00:00:00.000Z","note":"","url":"http://localhost:3000/@mastodonpy_test","avatar":"http://localhost:3000/avatars/original/missing.png","avatar_static":"http://localhost:3000/avatars/original/missing.png","header":"http://localhost:3000/headers/original/missing.png","header_static":"http://localhost:3000/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":0,"last_status_at":null,"noindex":false,"emojis":[],"fields":[]}},{"id":"109411885799291132","username":"admin2","domain":null,"created_at":"2022-11-26T20:01:26.347Z","email":"[email protected]","ip":"127.0.0.1","role":{"id":3,"name":"Owner","color":"","position":1000,"permissions":1,"highlighted":true,"created_at":"2022-11-26T20:01:24.338Z","updated_at":"2022-11-26T20:01:24.338Z"},"confirmed":true,"suspended":false,"silenced":false,"sensitized":false,"disabled":false,"approved":true,"locale":"de","invite_request":null,"ips":[{"ip":"127.0.0.1","used_at":"2022-11-26T20:02:19.675Z"}],"account":{"id":"109411885799291132","username":"admin2","acct":"admin2","display_name":"","locked":false,"bot":false,"discoverable":null,"group":false,"created_at":"2022-11-26T00:00:00.000Z","note":"","url":"http://localhost:3000/@admin2","avatar":"http://localhost:3000/avatars/original/missing.png","avatar_static":"http://localhost:3000/avatars/original/missing.png","header":"http://localhost:3000/headers/original/missing.png","header_static":"http://localhost:3000/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":0,"last_status_at":null,"noindex":false,"emojis":[],"fields":[]}},{"id":"109411885671340064","username":"admin","domain":null,"created_at":"2022-11-26T20:01:24.342Z","email":"admin@localhost:3000","ip":null,"role":{"id":3,"name":"Owner","color":"","position":1000,"permissions":1,"highlighted":true,"created_at":"2022-11-26T20:01:24.338Z","updated_at":"2022-11-26T20:01:24.338Z"},"confirmed":true,"suspended":false,"silenced":false,"sensitized":false,"disabled":false,"approved":true,"locale":null,"invite_request":null,"ips":[],"account":{"id":"109411885671340064","username":"admin","acct":"admin","display_name":"","locked":false,"bot":false,"discoverable":null,"group":false,"created_at":"2022-11-26T00:00:00.000Z","note":"","url":"http://localhost:3000/@admin","avatar":"http://localhost:3000/avatars/original/missing.png","avatar_static":"http://localhost:3000/avatars/original/missing.png","header":"http://localhost:3000/headers/original/missing.png","header_static":"http://localhost:3000/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":0,"last_status_at":null,"noindex":false,"emojis":[],"fields":[]}}]' | ||
20 | headers: | ||
21 | Cache-Control: | ||
22 | - no-store | ||
23 | Content-Security-Policy: | ||
24 | - 'base-uri ''none''; default-src ''none''; frame-ancestors ''none''; font-src | ||
25 | ''self'' http://localhost:3000; img-src ''self'' https: data: blob: http://localhost:3000; | ||
26 | style-src ''self'' http://localhost:3000 ''nonce-rha1g8vCqT8/tDp8mtlrdg==''; | ||
27 | media-src ''self'' https: data: http://localhost:3000; frame-src ''self'' | ||
28 | https:; manifest-src ''self'' http://localhost:3000; connect-src ''self'' | ||
29 | data: blob: http://localhost:3000 http://localhost:3000 ws://localhost:4000 | ||
30 | ws://localhost:3035 http://localhost:3035; script-src ''self'' ''unsafe-inline'' | ||
31 | ''unsafe-eval'' http://localhost:3000; child-src ''self'' blob: http://localhost:3000; | ||
32 | worker-src ''self'' blob: http://localhost:3000' | ||
33 | Content-Type: | ||
34 | - application/json; charset=utf-8 | ||
35 | ETag: | ||
36 | - W/"70761e00feb13529509779ca3060705b" | ||
37 | Link: | ||
38 | - <http://localhost:3000/api/v1/admin/accounts?active=True&min_id=109411886050231694>; | ||
39 | rel="prev" | ||
40 | Referrer-Policy: | ||
41 | - strict-origin-when-cross-origin | ||
42 | Transfer-Encoding: | ||
43 | - chunked | ||
44 | Vary: | ||
45 | - Accept, Origin | ||
46 | X-Content-Type-Options: | ||
47 | - nosniff | ||
48 | X-Download-Options: | ||
49 | - noopen | ||
50 | X-Frame-Options: | ||
51 | - SAMEORIGIN | ||
52 | X-Permitted-Cross-Domain-Policies: | ||
53 | - none | ||
54 | X-Request-Id: | ||
55 | - 2e6b413e-114f-495b-8e0e-870b11ea4195 | ||
56 | X-Runtime: | ||
57 | - '0.174018' | ||
58 | X-XSS-Protection: | ||
59 | - 1; mode=block | ||
60 | status: | ||
61 | code: 200 | ||
62 | message: OK | ||
63 | - request: | ||
64 | body: null | ||
65 | headers: | ||
66 | Accept: | ||
67 | - '*/*' | ||
68 | Accept-Encoding: | ||
69 | - gzip, deflate | ||
70 | Authorization: | ||
71 | - Bearer __MASTODON_PY_TEST_ACCESS_TOKEN_2 | ||
72 | Connection: | ||
73 | - keep-alive | ||
74 | User-Agent: | ||
75 | - tests/v311 | ||
76 | method: GET | ||
77 | uri: http://localhost:3000/api/v1/accounts/verify_credentials | ||
78 | response: | ||
79 | body: | ||
80 | string: '{"id":"109411885671340064","username":"admin","acct":"admin","display_name":"","locked":false,"bot":false,"discoverable":null,"group":false,"created_at":"2022-11-26T00:00:00.000Z","note":"","url":"http://localhost:3000/@admin","avatar":"http://localhost:3000/avatars/original/missing.png","avatar_static":"http://localhost:3000/avatars/original/missing.png","header":"http://localhost:3000/headers/original/missing.png","header_static":"http://localhost:3000/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":0,"last_status_at":null,"noindex":false,"source":{"privacy":"public","sensitive":false,"language":null,"note":"","fields":[],"follow_requests_count":0},"emojis":[],"fields":[],"role":{"id":"3","name":"Owner","permissions":"1048575","color":"","highlighted":true}}' | ||
81 | headers: | ||
82 | Cache-Control: | ||
83 | - no-store | ||
84 | Content-Security-Policy: | ||
85 | - 'base-uri ''none''; default-src ''none''; frame-ancestors ''none''; font-src | ||
86 | ''self'' http://localhost:3000; img-src ''self'' https: data: blob: http://localhost:3000; | ||
87 | style-src ''self'' http://localhost:3000 ''nonce-SRfegda7FJ4bXLLndhYA9g==''; | ||
88 | media-src ''self'' https: data: http://localhost:3000; frame-src ''self'' | ||
89 | https:; manifest-src ''self'' http://localhost:3000; connect-src ''self'' | ||
90 | data: blob: http://localhost:3000 http://localhost:3000 ws://localhost:4000 | ||
91 | ws://localhost:3035 http://localhost:3035; script-src ''self'' ''unsafe-inline'' | ||
92 | ''unsafe-eval'' http://localhost:3000; child-src ''self'' blob: http://localhost:3000; | ||
93 | worker-src ''self'' blob: http://localhost:3000' | ||
94 | Content-Type: | ||
95 | - application/json; charset=utf-8 | ||
96 | ETag: | ||
97 | - W/"a92dcb08b6f874d680c45eede3cca2ec" | ||
98 | Referrer-Policy: | ||
99 | - strict-origin-when-cross-origin | ||
100 | Transfer-Encoding: | ||
101 | - chunked | ||
102 | Vary: | ||
103 | - Accept, Origin | ||
104 | X-Content-Type-Options: | ||
105 | - nosniff | ||
106 | X-Download-Options: | ||
107 | - noopen | ||
108 | X-Frame-Options: | ||
109 | - SAMEORIGIN | ||
110 | X-Permitted-Cross-Domain-Policies: | ||
111 | - none | ||
112 | X-Request-Id: | ||
113 | - 5b1a9983-a201-4b01-8279-4f24d394cde0 | ||
114 | X-Runtime: | ||
115 | - '0.019987' | ||
116 | X-XSS-Protection: | ||
117 | - 1; mode=block | ||
118 | status: | ||
119 | code: 200 | ||
120 | message: OK | ||
121 | - request: | ||
122 | body: null | ||
123 | headers: | ||
124 | Accept: | ||
125 | - '*/*' | ||
126 | Accept-Encoding: | ||
127 | - gzip, deflate | ||
128 | Authorization: | ||
129 | - Bearer __MASTODON_PY_TEST_ACCESS_TOKEN_2 | ||
130 | Connection: | ||
131 | - keep-alive | ||
132 | User-Agent: | ||
133 | - tests/v311 | ||
134 | method: GET | ||
135 | uri: http://localhost:3000/api/v1/admin/accounts/109411885671340064 | ||
136 | response: | ||
137 | body: | ||
138 | string: '{"id":"109411885671340064","username":"admin","domain":null,"created_at":"2022-11-26T20:01:24.342Z","email":"admin@localhost:3000","ip":null,"role":{"id":3,"name":"Owner","color":"","position":1000,"permissions":1,"highlighted":true,"created_at":"2022-11-26T20:01:24.338Z","updated_at":"2022-11-26T20:01:24.338Z"},"confirmed":true,"suspended":false,"silenced":false,"sensitized":false,"disabled":false,"approved":true,"locale":null,"invite_request":null,"ips":[],"account":{"id":"109411885671340064","username":"admin","acct":"admin","display_name":"","locked":false,"bot":false,"discoverable":null,"group":false,"created_at":"2022-11-26T00:00:00.000Z","note":"","url":"http://localhost:3000/@admin","avatar":"http://localhost:3000/avatars/original/missing.png","avatar_static":"http://localhost:3000/avatars/original/missing.png","header":"http://localhost:3000/headers/original/missing.png","header_static":"http://localhost:3000/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":0,"last_status_at":null,"noindex":false,"emojis":[],"fields":[]}}' | ||
139 | headers: | ||
140 | Cache-Control: | ||
141 | - no-store | ||
142 | Content-Security-Policy: | ||
143 | - 'base-uri ''none''; default-src ''none''; frame-ancestors ''none''; font-src | ||
144 | ''self'' http://localhost:3000; img-src ''self'' https: data: blob: http://localhost:3000; | ||
145 | style-src ''self'' http://localhost:3000 ''nonce-Xr1816+FDipTuvfoqQHZ2A==''; | ||
146 | media-src ''self'' https: data: http://localhost:3000; frame-src ''self'' | ||
147 | https:; manifest-src ''self'' http://localhost:3000; connect-src ''self'' | ||
148 | data: blob: http://localhost:3000 http://localhost:3000 ws://localhost:4000 | ||
149 | ws://localhost:3035 http://localhost:3035; script-src ''self'' ''unsafe-inline'' | ||
150 | ''unsafe-eval'' http://localhost:3000; child-src ''self'' blob: http://localhost:3000; | ||
151 | worker-src ''self'' blob: http://localhost:3000' | ||
152 | Content-Type: | ||
153 | - application/json; charset=utf-8 | ||
154 | ETag: | ||
155 | - W/"7fabd2598ffb35064504f9e5215e21e6" | ||
156 | Referrer-Policy: | ||
157 | - strict-origin-when-cross-origin | ||
158 | Transfer-Encoding: | ||
159 | - chunked | ||
160 | Vary: | ||
161 | - Accept, Origin | ||
162 | X-Content-Type-Options: | ||
163 | - nosniff | ||
164 | X-Download-Options: | ||
165 | - noopen | ||
166 | X-Frame-Options: | ||
167 | - SAMEORIGIN | ||
168 | X-Permitted-Cross-Domain-Policies: | ||
169 | - none | ||
170 | X-Request-Id: | ||
171 | - eec919d4-f033-4d8a-a74c-b7c5f9f82df2 | ||
172 | X-Runtime: | ||
173 | - '0.020002' | ||
174 | X-XSS-Protection: | ||
175 | - 1; mode=block | ||
176 | status: | ||
177 | code: 200 | ||
178 | message: OK | ||
179 | version: 1 | ||
diff --git a/tests/cassettes/test_admin_accounts_v2.yaml b/tests/cassettes/test_admin_accounts_v2.yaml new file mode 100644 index 0000000..5b5e041 --- /dev/null +++ b/tests/cassettes/test_admin_accounts_v2.yaml | |||
@@ -0,0 +1,237 @@ | |||
1 | interactions: | ||
2 | - request: | ||
3 | body: null | ||
4 | headers: | ||
5 | Accept: | ||
6 | - '*/*' | ||
7 | Accept-Encoding: | ||
8 | - gzip, deflate | ||
9 | Authorization: | ||
10 | - Bearer __MASTODON_PY_TEST_ACCESS_TOKEN_2 | ||
11 | Connection: | ||
12 | - keep-alive | ||
13 | User-Agent: | ||
14 | - tests/v311 | ||
15 | method: GET | ||
16 | uri: http://localhost:3000/api/v2/admin/accounts?origin=local&permissions=staff | ||
17 | response: | ||
18 | body: | ||
19 | string: '[{"id":"109411885799291132","username":"admin2","domain":null,"created_at":"2022-11-26T20:01:26.347Z","email":"[email protected]","ip":"127.0.0.1","role":{"id":3,"name":"Owner","color":"","position":1000,"permissions":1,"highlighted":true,"created_at":"2022-11-26T20:01:24.338Z","updated_at":"2022-11-26T20:01:24.338Z"},"confirmed":true,"suspended":false,"silenced":false,"sensitized":false,"disabled":false,"approved":true,"locale":"de","invite_request":null,"ips":[{"ip":"127.0.0.1","used_at":"2022-11-26T20:02:19.675Z"}],"account":{"id":"109411885799291132","username":"admin2","acct":"admin2","display_name":"","locked":false,"bot":false,"discoverable":null,"group":false,"created_at":"2022-11-26T00:00:00.000Z","note":"","url":"http://localhost:3000/@admin2","avatar":"http://localhost:3000/avatars/original/missing.png","avatar_static":"http://localhost:3000/avatars/original/missing.png","header":"http://localhost:3000/headers/original/missing.png","header_static":"http://localhost:3000/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":0,"last_status_at":null,"noindex":false,"emojis":[],"fields":[]}},{"id":"109411885671340064","username":"admin","domain":null,"created_at":"2022-11-26T20:01:24.342Z","email":"admin@localhost:3000","ip":null,"role":{"id":3,"name":"Owner","color":"","position":1000,"permissions":1,"highlighted":true,"created_at":"2022-11-26T20:01:24.338Z","updated_at":"2022-11-26T20:01:24.338Z"},"confirmed":true,"suspended":false,"silenced":false,"sensitized":false,"disabled":false,"approved":true,"locale":null,"invite_request":null,"ips":[],"account":{"id":"109411885671340064","username":"admin","acct":"admin","display_name":"","locked":false,"bot":false,"discoverable":null,"group":false,"created_at":"2022-11-26T00:00:00.000Z","note":"","url":"http://localhost:3000/@admin","avatar":"http://localhost:3000/avatars/original/missing.png","avatar_static":"http://localhost:3000/avatars/original/missing.png","header":"http://localhost:3000/headers/original/missing.png","header_static":"http://localhost:3000/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":0,"last_status_at":null,"noindex":false,"emojis":[],"fields":[]}}]' | ||
20 | headers: | ||
21 | Cache-Control: | ||
22 | - no-store | ||
23 | Content-Security-Policy: | ||
24 | - 'base-uri ''none''; default-src ''none''; frame-ancestors ''none''; font-src | ||
25 | ''self'' http://localhost:3000; img-src ''self'' https: data: blob: http://localhost:3000; | ||
26 | style-src ''self'' http://localhost:3000 ''nonce-i6KQJf/pTUkNc5Iqg28llQ==''; | ||
27 | media-src ''self'' https: data: http://localhost:3000; frame-src ''self'' | ||
28 | https:; manifest-src ''self'' http://localhost:3000; connect-src ''self'' | ||
29 | data: blob: http://localhost:3000 http://localhost:3000 ws://localhost:4000 | ||
30 | ws://localhost:3035 http://localhost:3035; script-src ''self'' ''unsafe-inline'' | ||
31 | ''unsafe-eval'' http://localhost:3000; child-src ''self'' blob: http://localhost:3000; | ||
32 | worker-src ''self'' blob: http://localhost:3000' | ||
33 | Content-Type: | ||
34 | - application/json; charset=utf-8 | ||
35 | ETag: | ||
36 | - W/"4ad52a55c7bd828f38a03190a044caff" | ||
37 | Link: | ||
38 | - <http://localhost:3000/api/v1/admin/accounts?min_id=109411885799291132&origin=local&permissions=staff>; | ||
39 | rel="prev" | ||
40 | Referrer-Policy: | ||
41 | - strict-origin-when-cross-origin | ||
42 | Transfer-Encoding: | ||
43 | - chunked | ||
44 | Vary: | ||
45 | - Accept, Origin | ||
46 | X-Content-Type-Options: | ||
47 | - nosniff | ||
48 | X-Download-Options: | ||
49 | - noopen | ||
50 | X-Frame-Options: | ||
51 | - SAMEORIGIN | ||
52 | X-Permitted-Cross-Domain-Policies: | ||
53 | - none | ||
54 | X-Request-Id: | ||
55 | - 67ac51e6-39dd-4859-896c-db8daa32e970 | ||
56 | X-Runtime: | ||
57 | - '0.031220' | ||
58 | X-XSS-Protection: | ||
59 | - 1; mode=block | ||
60 | status: | ||
61 | code: 200 | ||
62 | message: OK | ||
63 | - request: | ||
64 | body: null | ||
65 | headers: | ||
66 | Accept: | ||
67 | - '*/*' | ||
68 | Accept-Encoding: | ||
69 | - gzip, deflate | ||
70 | Authorization: | ||
71 | - Bearer __MASTODON_PY_TEST_ACCESS_TOKEN_2 | ||
72 | Connection: | ||
73 | - keep-alive | ||
74 | User-Agent: | ||
75 | - tests/v311 | ||
76 | method: GET | ||
77 | uri: http://localhost:3000/api/v1/accounts/verify_credentials | ||
78 | response: | ||
79 | body: | ||
80 | string: '{"id":"109411885671340064","username":"admin","acct":"admin","display_name":"","locked":false,"bot":false,"discoverable":null,"group":false,"created_at":"2022-11-26T00:00:00.000Z","note":"","url":"http://localhost:3000/@admin","avatar":"http://localhost:3000/avatars/original/missing.png","avatar_static":"http://localhost:3000/avatars/original/missing.png","header":"http://localhost:3000/headers/original/missing.png","header_static":"http://localhost:3000/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":0,"last_status_at":null,"noindex":false,"source":{"privacy":"public","sensitive":false,"language":null,"note":"","fields":[],"follow_requests_count":0},"emojis":[],"fields":[],"role":{"id":"3","name":"Owner","permissions":"1048575","color":"","highlighted":true}}' | ||
81 | headers: | ||
82 | Cache-Control: | ||
83 | - no-store | ||
84 | Content-Security-Policy: | ||
85 | - 'base-uri ''none''; default-src ''none''; frame-ancestors ''none''; font-src | ||
86 | ''self'' http://localhost:3000; img-src ''self'' https: data: blob: http://localhost:3000; | ||
87 | style-src ''self'' http://localhost:3000 ''nonce-4FwT6Ya41GHCR7ZSi+el3A==''; | ||
88 | media-src ''self'' https: data: http://localhost:3000; frame-src ''self'' | ||
89 | https:; manifest-src ''self'' http://localhost:3000; connect-src ''self'' | ||
90 | data: blob: http://localhost:3000 http://localhost:3000 ws://localhost:4000 | ||
91 | ws://localhost:3035 http://localhost:3035; script-src ''self'' ''unsafe-inline'' | ||
92 | ''unsafe-eval'' http://localhost:3000; child-src ''self'' blob: http://localhost:3000; | ||
93 | worker-src ''self'' blob: http://localhost:3000' | ||
94 | Content-Type: | ||
95 | - application/json; charset=utf-8 | ||
96 | ETag: | ||
97 | - W/"a92dcb08b6f874d680c45eede3cca2ec" | ||
98 | Referrer-Policy: | ||
99 | - strict-origin-when-cross-origin | ||
100 | Transfer-Encoding: | ||
101 | - chunked | ||
102 | Vary: | ||
103 | - Accept, Origin | ||
104 | X-Content-Type-Options: | ||
105 | - nosniff | ||
106 | X-Download-Options: | ||
107 | - noopen | ||
108 | X-Frame-Options: | ||
109 | - SAMEORIGIN | ||
110 | X-Permitted-Cross-Domain-Policies: | ||
111 | - none | ||
112 | X-Request-Id: | ||
113 | - f5d704f6-5e3b-4438-b406-5dea67ed9a86 | ||
114 | X-Runtime: | ||
115 | - '0.016054' | ||
116 | X-XSS-Protection: | ||
117 | - 1; mode=block | ||
118 | status: | ||
119 | code: 200 | ||
120 | message: OK | ||
121 | - request: | ||
122 | body: null | ||
123 | headers: | ||
124 | Accept: | ||
125 | - '*/*' | ||
126 | Accept-Encoding: | ||
127 | - gzip, deflate | ||
128 | Authorization: | ||
129 | - Bearer __MASTODON_PY_TEST_ACCESS_TOKEN_2 | ||
130 | Connection: | ||
131 | - keep-alive | ||
132 | User-Agent: | ||
133 | - tests/v311 | ||
134 | method: GET | ||
135 | uri: http://localhost:3000/api/v1/admin/accounts/109411885671340064 | ||
136 | response: | ||
137 | body: | ||
138 | string: '{"id":"109411885671340064","username":"admin","domain":null,"created_at":"2022-11-26T20:01:24.342Z","email":"admin@localhost:3000","ip":null,"role":{"id":3,"name":"Owner","color":"","position":1000,"permissions":1,"highlighted":true,"created_at":"2022-11-26T20:01:24.338Z","updated_at":"2022-11-26T20:01:24.338Z"},"confirmed":true,"suspended":false,"silenced":false,"sensitized":false,"disabled":false,"approved":true,"locale":null,"invite_request":null,"ips":[],"account":{"id":"109411885671340064","username":"admin","acct":"admin","display_name":"","locked":false,"bot":false,"discoverable":null,"group":false,"created_at":"2022-11-26T00:00:00.000Z","note":"","url":"http://localhost:3000/@admin","avatar":"http://localhost:3000/avatars/original/missing.png","avatar_static":"http://localhost:3000/avatars/original/missing.png","header":"http://localhost:3000/headers/original/missing.png","header_static":"http://localhost:3000/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":0,"last_status_at":null,"noindex":false,"emojis":[],"fields":[]}}' | ||
139 | headers: | ||
140 | Cache-Control: | ||
141 | - no-store | ||
142 | Content-Security-Policy: | ||
143 | - 'base-uri ''none''; default-src ''none''; frame-ancestors ''none''; font-src | ||
144 | ''self'' http://localhost:3000; img-src ''self'' https: data: blob: http://localhost:3000; | ||
145 | style-src ''self'' http://localhost:3000 ''nonce-7x8Gs/Uz7sVtsdZvlOnFsQ==''; | ||
146 | media-src ''self'' https: data: http://localhost:3000; frame-src ''self'' | ||
147 | https:; manifest-src ''self'' http://localhost:3000; connect-src ''self'' | ||
148 | data: blob: http://localhost:3000 http://localhost:3000 ws://localhost:4000 | ||
149 | ws://localhost:3035 http://localhost:3035; script-src ''self'' ''unsafe-inline'' | ||
150 | ''unsafe-eval'' http://localhost:3000; child-src ''self'' blob: http://localhost:3000; | ||
151 | worker-src ''self'' blob: http://localhost:3000' | ||
152 | Content-Type: | ||
153 | - application/json; charset=utf-8 | ||
154 | ETag: | ||
155 | - W/"7fabd2598ffb35064504f9e5215e21e6" | ||
156 | Referrer-Policy: | ||
157 | - strict-origin-when-cross-origin | ||
158 | Transfer-Encoding: | ||
159 | - chunked | ||
160 | Vary: | ||
161 | - Accept, Origin | ||
162 | X-Content-Type-Options: | ||
163 | - nosniff | ||
164 | X-Download-Options: | ||
165 | - noopen | ||
166 | X-Frame-Options: | ||
167 | - SAMEORIGIN | ||
168 | X-Permitted-Cross-Domain-Policies: | ||
169 | - none | ||
170 | X-Request-Id: | ||
171 | - 86e6959f-0c1d-4f6c-840d-59619a50a4cd | ||
172 | X-Runtime: | ||
173 | - '0.016896' | ||
174 | X-XSS-Protection: | ||
175 | - 1; mode=block | ||
176 | status: | ||
177 | code: 200 | ||
178 | message: OK | ||
179 | - request: | ||
180 | body: null | ||
181 | headers: | ||
182 | Accept: | ||
183 | - '*/*' | ||
184 | Accept-Encoding: | ||
185 | - gzip, deflate | ||
186 | Authorization: | ||
187 | - Bearer __MASTODON_PY_TEST_ACCESS_TOKEN_2 | ||
188 | Connection: | ||
189 | - keep-alive | ||
190 | User-Agent: | ||
191 | - tests/v311 | ||
192 | method: GET | ||
193 | uri: http://localhost:3000/api/v2/admin/accounts?origin=remote&permissions=staff | ||
194 | response: | ||
195 | body: | ||
196 | string: '[]' | ||
197 | headers: | ||
198 | Cache-Control: | ||
199 | - no-store | ||
200 | Content-Security-Policy: | ||
201 | - 'base-uri ''none''; default-src ''none''; frame-ancestors ''none''; font-src | ||
202 | ''self'' http://localhost:3000; img-src ''self'' https: data: blob: http://localhost:3000; | ||
203 | style-src ''self'' http://localhost:3000 ''nonce-deIQ40i1Hr9YZswIHlu1Wg==''; | ||
204 | media-src ''self'' https: data: http://localhost:3000; frame-src ''self'' | ||
205 | https:; manifest-src ''self'' http://localhost:3000; connect-src ''self'' | ||
206 | data: blob: http://localhost:3000 http://localhost:3000 ws://localhost:4000 | ||
207 | ws://localhost:3035 http://localhost:3035; script-src ''self'' ''unsafe-inline'' | ||
208 | ''unsafe-eval'' http://localhost:3000; child-src ''self'' blob: http://localhost:3000; | ||
209 | worker-src ''self'' blob: http://localhost:3000' | ||
210 | Content-Type: | ||
211 | - application/json; charset=utf-8 | ||
212 | ETag: | ||
213 | - W/"4f53cda18c2baa0c0354bb5f9a3ecbe5" | ||
214 | Referrer-Policy: | ||
215 | - strict-origin-when-cross-origin | ||
216 | Transfer-Encoding: | ||
217 | - chunked | ||
218 | Vary: | ||
219 | - Accept, Origin | ||
220 | X-Content-Type-Options: | ||
221 | - nosniff | ||
222 | X-Download-Options: | ||
223 | - noopen | ||
224 | X-Frame-Options: | ||
225 | - SAMEORIGIN | ||
226 | X-Permitted-Cross-Domain-Policies: | ||
227 | - none | ||
228 | X-Request-Id: | ||
229 | - b0b0702f-c15a-4d39-9996-a2c4c2ad5a6f | ||
230 | X-Runtime: | ||
231 | - '0.016651' | ||
232 | X-XSS-Protection: | ||
233 | - 1; mode=block | ||
234 | status: | ||
235 | code: 200 | ||
236 | message: OK | ||
237 | version: 1 | ||
diff --git a/tests/test_admin.py b/tests/test_admin.py index d937ed8..b0716e5 100644 --- a/tests/test_admin.py +++ b/tests/test_admin.py | |||
@@ -16,6 +16,44 @@ def test_admin_accounts(api2): | |||
16 | assert(account_admin) | 16 | assert(account_admin) |
17 | assert(account_admin.id == account_self.id) | 17 | assert(account_admin.id == account_self.id) |
18 | 18 | ||
19 | @pytest.mark.vcr() | ||
20 | def test_admin_accounts_v1(api2): | ||
21 | accounts = api2.admin_accounts_v1() | ||
22 | |||
23 | assert accounts | ||
24 | assert len(accounts) > 0 | ||
25 | |||
26 | account_self = api2.account_verify_credentials() | ||
27 | account_admin = api2.admin_account(account_self) | ||
28 | |||
29 | assert(account_admin) | ||
30 | assert(account_admin.id == account_self.id) | ||
31 | |||
32 | @pytest.mark.vcr() | ||
33 | def test_admin_accounts_v2(api2): | ||
34 | accounts = api2.admin_accounts_v2(permissions="staff", origin="local") | ||
35 | |||
36 | assert accounts | ||
37 | assert len(accounts) > 0 | ||
38 | |||
39 | account_self = api2.account_verify_credentials() | ||
40 | account_admin = api2.admin_account(account_self) | ||
41 | |||
42 | assert(account_admin) | ||
43 | assert(account_admin.id == account_self.id) | ||
44 | |||
45 | accounts = api2.admin_accounts_v2(permissions="staff", origin="remote") | ||
46 | assert len(accounts) == 0 | ||
47 | |||
48 | with pytest.raises(MastodonIllegalArgumentError): | ||
49 | accounts = api2.admin_accounts_v2(permissions="stave") | ||
50 | |||
51 | with pytest.raises(MastodonIllegalArgumentError): | ||
52 | accounts = api2.admin_accounts_v2(origin="global") | ||
53 | |||
54 | with pytest.raises(MastodonIllegalArgumentError): | ||
55 | accounts = api2.admin_accounts_v2(status="sick") | ||
56 | |||
19 | @pytest.mark.vcr(match_on=['path']) | 57 | @pytest.mark.vcr(match_on=['path']) |
20 | def test_admin_moderation(api, api2): | 58 | def test_admin_moderation(api, api2): |
21 | account_initial = api.account_verify_credentials() | 59 | account_initial = api.account_verify_credentials() |
diff --git a/tests/test_constructor.py b/tests/test_constructor.py index ed38b9c..2531e19 100644 --- a/tests/test_constructor.py +++ b/tests/test_constructor.py | |||
@@ -18,9 +18,14 @@ def test_constructor_from_filenames(tmpdir): | |||
18 | 18 | ||
19 | def test_constructor_illegal_ratelimit(): | 19 | def test_constructor_illegal_ratelimit(): |
20 | with pytest.raises(MastodonIllegalArgumentError): | 20 | with pytest.raises(MastodonIllegalArgumentError): |
21 | api = Mastodon( | 21 | api = Mastodon('foo', client_secret='bar', ratelimit_method='baz', api_base_url="whatever") |
22 | 'foo', client_secret='bar', | 22 | |
23 | ratelimit_method='baz') | 23 | def test_constructor_no_url(): |
24 | with pytest.raises(MastodonIllegalArgumentError): | ||
25 | api = Mastodon('foo', client_secret='bar') | ||
26 | |||
27 | with pytest.raises(MastodonIllegalArgumentError): | ||
28 | api = Mastodon(access_token='baz') | ||
24 | 29 | ||
25 | def test_constructor_illegal_versioncheckmode(): | 30 | def test_constructor_illegal_versioncheckmode(): |
26 | with pytest.raises(MastodonIllegalArgumentError): | 31 | with pytest.raises(MastodonIllegalArgumentError): |