mirror of
https://github.com/ReVanced/revanced-api.git
synced 2026-01-11 13:56:17 +00:00
test: add info and donations tests
This commit is contained in:
@@ -11,7 +11,7 @@ class InfoFields(BaseModel):
|
||||
name: str
|
||||
about: str
|
||||
contact: dict[str, str]
|
||||
socials: SocialFields
|
||||
socials: list[SocialFields]
|
||||
donations: DonationFields
|
||||
|
||||
|
||||
|
||||
15
tests/test_donations.py
Normal file
15
tests/test_donations.py
Normal file
@@ -0,0 +1,15 @@
|
||||
import pytest
|
||||
from sanic import Sanic
|
||||
|
||||
from api.models.donations import DonationsResponseModel
|
||||
|
||||
from config import api_version
|
||||
|
||||
# donations
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_donations(app: Sanic):
|
||||
_, response = await app.asgi_client.get(f"/{api_version}/donations")
|
||||
assert response.status == 200
|
||||
assert DonationsResponseModel(**response.json)
|
||||
16
tests/test_info.py
Normal file
16
tests/test_info.py
Normal file
@@ -0,0 +1,16 @@
|
||||
import pytest
|
||||
from sanic import Sanic
|
||||
|
||||
from api.models.info import InfoResponseModel
|
||||
|
||||
from config import api_version
|
||||
|
||||
# info
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_info(app: Sanic):
|
||||
_, response = await app.asgi_client.get(f"/{api_version}/info")
|
||||
assert response.status == 200
|
||||
print(response.json)
|
||||
assert InfoResponseModel(**response.json)
|
||||
Reference in New Issue
Block a user