Skip to content
Merged
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ jobs:
- name: Install
run: python -m pip install .[dev]
- name: Test with pytest
run: pytest
run: pytest -x --cov=topgg --cov-report term-missing
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ dev = ["mock>=5.2.0", "pytest>=9.0.3", "pytest-asyncio>=1.3.0", "pytest-mock>=3.

[project.urls]
Documentation = "https://topggpy.readthedocs.io/en/latest/"
"Raw API Documentation" = "https://docs.top.gg/docs/"
"Raw API Documentation" = "https://docs.top.gg/api/v1/introduction"
Repository = "https://github.com/top-gg-community/python-sdk"
"Support server" = "https://discord.gg/EYHTgJX"

Expand Down
5 changes: 4 additions & 1 deletion ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@ indent-width = 2
docstring-code-format = true
docstring-code-line-length = 88
line-ending = "lf"
quote-style = "single"
quote-style = "single"

[lint]
ignore = ["E722", "E731"]
8 changes: 4 additions & 4 deletions tests/mocks/404.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"title": "User not found",
"status": 404,
"detail": "The user was not resolved into a valid Top.gg user. The user ID might be invalid, or the user may have deleted their account."
{
"title": "User not found",
"status": 404,
"detail": "The user was not resolved into a valid Top.gg user. The user ID might be invalid, or the user may have deleted their account."
}
30 changes: 15 additions & 15 deletions tests/mocks/get_self.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"id": "364806029876555776",
"name": "Top.gg Lib Dev API Access",
"type": "bot",
"platform": "discord",
"headline": "API access for Top.gg Library Developers",
"tags": [
"api",
"library",
"topgg"
],
"votes": 4,
"votes_total": 34,
"review_score": 5,
"review_count": 2
{
"id": "364806029876555776",
"name": "Top.gg Lib Dev API Access",
"type": "bot",
"platform": "discord",
"headline": "API access for Top.gg Library Developers",
"tags": [
"api",
"library",
"topgg"
],
"votes": 4,
"votes_total": 34,
"review_score": 5,
"review_count": 2
}
8 changes: 4 additions & 4 deletions tests/mocks/get_vote.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"created_at": "2026-02-25T22:35:36.978392+00:00",
"expires_at": "2026-02-26T10:35:36.978392+00:00",
"weight": 1
{
"created_at": "2026-02-25T22:35:36.978392+00:00",
"expires_at": "2026-02-26T10:35:36.978392+00:00",
"weight": 1
}
64 changes: 32 additions & 32 deletions tests/mocks/get_votes.json
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
{
"cursor": "",
"data": [
{
"user_id": "800506814562787328",
"platform_id": "1461830808796139662",
"weight": 2,
"created_at": "2026-01-17T23:36:06.34732Z",
"expires_at": "2026-01-18T11:36:06.34732Z"
},
{
"user_id": "316026718115037184",
"platform_id": "481068576363773972",
"weight": 2,
"created_at": "2026-02-20T05:43:58.392411Z",
"expires_at": "2026-02-20T17:43:58.392411Z"
},
{
"user_id": "794153497215045632",
"platform_id": "1425259851600101457",
"weight": 2,
"created_at": "2026-02-21T18:59:20.660734Z",
"expires_at": "2026-02-22T06:59:20.660734Z"
},
{
"user_id": "8226924471638491136",
"platform_id": "661200758510977084",
"weight": 1,
"created_at": "2026-02-25T22:35:36.978392Z",
"expires_at": "2026-02-26T10:35:36.978392Z"
}
]
{
"cursor": "",
"data": [
{
"user_id": "800506814562787328",
"platform_id": "1461830808796139662",
"weight": 2,
"created_at": "2026-01-17T23:36:06.34732Z",
"expires_at": "2026-01-18T11:36:06.34732Z"
},
{
"user_id": "316026718115037184",
"platform_id": "481068576363773972",
"weight": 2,
"created_at": "2026-02-20T05:43:58.392411Z",
"expires_at": "2026-02-20T17:43:58.392411Z"
},
{
"user_id": "794153497215045632",
"platform_id": "1425259851600101457",
"weight": 2,
"created_at": "2026-02-21T18:59:20.660734Z",
"expires_at": "2026-02-22T06:59:20.660734Z"
},
{
"user_id": "8226924471638491136",
"platform_id": "661200758510977084",
"weight": 1,
"created_at": "2026-02-25T22:35:36.978392Z",
"expires_at": "2026-02-26T10:35:36.978392Z"
}
]
}
36 changes: 18 additions & 18 deletions tests/mocks/integration_create_payload.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"type": "integration.create",
"data": {
"connection_id": "112402021105124",
"webhook_secret": "whs_abcd",
"project": {
"id": "1230954036934033243",
"platform": "discord",
"platform_id": "3949456393249234923",
"type": "bot"
},
"user": {
"id": "3949456393249234923",
"platform_id": "3949456393249234923",
"name": "username",
"avatar_url": "<avatar url>"
}
}
{
"type": "integration.create",
"data": {
"connection_id": "112402021105124",
"webhook_secret": "whs_abcd",
"project": {
"id": "1230954036934033243",
"platform": "discord",
"platform_id": "3949456393249234923",
"type": "bot"
},
"user": {
"id": "3949456393249234923",
"platform_id": "3949456393249234923",
"name": "username",
"avatar_url": "<avatar url>"
}
}
}
10 changes: 5 additions & 5 deletions tests/mocks/integration_delete_payload.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"type": "integration.delete",
"data": {
"connection_id": "112402021105124"
}
{
"type": "integration.delete",
"data": {
"connection_id": "112402021105124"
}
}
5 changes: 5 additions & 0 deletions tests/mocks/post_announcement.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"title": "Version 2.0 Released!",
"content": "We just released version 2.0 with a bunch of new features and improvements.",
"created_at": "2026-03-14T15:09:26Z"
}
32 changes: 16 additions & 16 deletions tests/mocks/test_payload.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"type": "webhook.test",
"data": {
"user": {
"id": "160105994217586689",
"platform_id": "160105994217586689",
"name": "username",
"avatar_url": "<avatar url>"
},
"project": {
"id": "803190510032756736",
"type": "bot",
"platform": "discord",
"platform_id": "160105994217586689"
}
}
{
"type": "webhook.test",
"data": {
"user": {
"id": "160105994217586689",
"platform_id": "160105994217586689",
"name": "username",
"avatar_url": "<avatar url>"
},
"project": {
"id": "803190510032756736",
"type": "bot",
"platform": "discord",
"platform_id": "160105994217586689"
}
}
}
40 changes: 20 additions & 20 deletions tests/mocks/vote_create_payload.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
{
"type": "vote.create",
"data": {
"id": "808499215864008704",
"weight": 1,
"created_at": "2026-02-09T00:47:14.2510149+00:00",
"expires_at": "2026-02-09T12:47:14.2510149+00:00",
"project": {
"id": "803190510032756736",
"type": "bot",
"platform": "discord",
"platform_id": "160105994217586689"
},
"user": {
"id": "160105994217586689",
"platform_id": "160105994217586689",
"name": "username",
"avatar_url": "<avatar url>"
}
}
{
"type": "vote.create",
"data": {
"id": "808499215864008704",
"weight": 1,
"created_at": "2026-02-09T00:47:14.2510149+00:00",
"expires_at": "2026-02-09T12:47:14.2510149+00:00",
"project": {
"id": "803190510032756736",
"type": "bot",
"platform": "discord",
"platform_id": "160105994217586689"
},
"user": {
"id": "160105994217586689",
"platform_id": "160105994217586689",
"name": "username",
"avatar_url": "<avatar url>"
}
}
}
Loading