some changes to tests and documentation

pull/419/head
halcy 2025-08-16 23:23:42 +03:00
rodzic bdc25ade29
commit d2c80f5210
3 zmienionych plików z 8 dodań i 0 usunięć

Wyświetl plik

@ -348,6 +348,8 @@ class Mastodon(Internals):
it is not present. it is not present.
Returns an empty dictionary if unsupported by the server. Returns an empty dictionary if unsupported by the server.
Technically added in 4.3.0 but we never do a version check to avoid potential complications.
""" """
assert self.api_base_url is not None assert self.api_base_url is not None
try: try:
@ -467,6 +469,8 @@ class Mastodon(Internals):
Return a string (which you should treat as opaque) that can be passed to :ref:`log_in()` to get an authenticated API object with the same access as this one. Return a string (which you should treat as opaque) that can be passed to :ref:`log_in()` to get an authenticated API object with the same access as this one.
This is the same thing that would be written to a file by :ref:`log_in() <log_in()>` with the `to_file` parameter. This is the same thing that would be written to a file by :ref:`log_in() <log_in()>` with the `to_file` parameter.
Obviously, treat it with care and store it in a manner that is appropriate for your application and the level of security you need.
""" """
if self.access_token is None: if self.access_token is None:
raise MastodonIllegalArgumentError("Not logged in, do not have a token to persist.") raise MastodonIllegalArgumentError("Not logged in, do not have a token to persist.")

Wyświetl plik

@ -64,6 +64,8 @@ def test_notifications_dismiss(api, mention):
notifications = api.notifications() notifications = api.notifications()
api.notifications_dismiss(notifications[0]) api.notifications_dismiss(notifications[0])
# skip these entirely now, 2.9.2 was a long time ago and we can't regenerate them.
@pytest.mark.skip("Skipping pre-2.9.2 tests")
def test_notifications_dismiss_pre_2_9_2(api, api2): def test_notifications_dismiss_pre_2_9_2(api, api2):
if sys.version_info > (3, 9): # 3.10 and up will not load the json data and regenerating it would require a 2.9.2 instance if sys.version_info > (3, 9): # 3.10 and up will not load the json data and regenerating it would require a 2.9.2 instance
pytest.skip("Test skipped for 3.10 and up") pytest.skip("Test skipped for 3.10 and up")

Wyświetl plik

@ -55,6 +55,8 @@ def test_status_card(api):
api.status_delete(status['id']) api.status_delete(status['id'])
# Old-version card api # Old-version card api
# skip these entirely now, 2.9.2 was a long time ago and we can't regenerate them.
@pytest.mark.skip("Skipping pre-2.9.2 tests")
def test_status_card_pre_2_9_2(api): def test_status_card_pre_2_9_2(api):
if sys.version_info > (3, 9): # 3.10 and up will not load the json data and regenerating it would require a 2.9.2 instance if sys.version_info > (3, 9): # 3.10 and up will not load the json data and regenerating it would require a 2.9.2 instance
pytest.skip("Test skipped for 3.10 and up") pytest.skip("Test skipped for 3.10 and up")