From 3b93f4ed492e186f097b08b2ed8cdc4a2e096d09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samu=C3=ABl=20WEBER?= Date: Wed, 6 Sep 2023 10:17:20 +0200 Subject: [PATCH] add about endpoint for site statistics --- src/pydiscourse/client.py | 6 ++++++ tests/test_client.py | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/src/pydiscourse/client.py b/src/pydiscourse/client.py index c31e34a..69e4a61 100644 --- a/src/pydiscourse/client.py +++ b/src/pydiscourse/client.py @@ -1500,6 +1500,12 @@ def notifications(self, category_id, **kwargs): """ return self._post(f"/category/{category_id}/notifications", **kwargs) + def about(self): + """ + Get site info + """ + return self._get("/about.json") + def _get(self, path, override_request_kwargs=None, **kwargs): """ diff --git a/tests/test_client.py b/tests/test_client.py index 08f7df7..530aa09 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -205,3 +205,10 @@ def test_grant_badge_to(self, discourse_client, discourse_request): assert request_payload["username"] == ["username"] assert request_payload["badge_id"] == ["1"] + + +class TestAbout: + def test_about(self, discourse_client, discourse_request): + request = discourse_request("get", "/about.json") + discourse_client.about() + assert request.called_once