mirror of
https://github.com/revanced/revanced-api.git
synced 2025-04-30 06:34:36 +02:00
test: add info and donations tests
This commit is contained in:
parent
4800ee96a8
commit
ffdb976f2c
@ -11,7 +11,7 @@ class InfoFields(BaseModel):
|
|||||||
name: str
|
name: str
|
||||||
about: str
|
about: str
|
||||||
contact: dict[str, str]
|
contact: dict[str, str]
|
||||||
socials: SocialFields
|
socials: list[SocialFields]
|
||||||
donations: DonationFields
|
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)
|
Loading…
x
Reference in New Issue
Block a user