Skip to content

Commit

Permalink
add about endpoint for site statistics
Browse files Browse the repository at this point in the history
  • Loading branch information
weber-s authored and bennylope committed Sep 7, 2023
1 parent 6d54153 commit a07b122
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/pydiscourse/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
"""
Expand Down
7 changes: 7 additions & 0 deletions tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit a07b122

Please sign in to comment.