def967a1a8
Removed the app/client fixtures duplicated across 36 test files (two variants: separate app + client(app), and a self-contained client() that called create_app inline) and the now-unused create_app imports. Both fixtures now live once in conftest.py. test_suggestions_bulk keeps its import (builds the app inline in two tests); test_health drops its local client + unused pytest_asyncio. Net -415 lines. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
42 lines
1.3 KiB
Python
42 lines
1.3 KiB
Python
import re
|
|
|
|
import pytest
|
|
|
|
|
|
pytestmark = pytest.mark.integration
|
|
|
|
|
|
@pytest.mark.asyncio
|
|
async def test_platforms_returns_gs_six(client):
|
|
resp = await client.get("/api/platforms")
|
|
assert resp.status_code == 200
|
|
body = await resp.get_json()
|
|
platforms = body["platforms"]
|
|
assert set(platforms.keys()) == {
|
|
"patreon", "subscribestar", "hentaifoundry",
|
|
"discord", "pixiv", "deviantart",
|
|
}
|
|
assert "fanbox" not in platforms
|
|
|
|
|
|
@pytest.mark.asyncio
|
|
async def test_platforms_record_shape(client):
|
|
body = await (await client.get("/api/platforms")).get_json()
|
|
patreon = body["platforms"]["patreon"]
|
|
for key in (
|
|
"key", "name", "description", "auth_type", "requires_auth",
|
|
"url_pattern", "url_examples", "default_config", "notes",
|
|
):
|
|
assert key in patreon
|
|
assert patreon["auth_type"] == "cookies"
|
|
re.compile(patreon["url_pattern"])
|
|
assert patreon["default_config"]["sleep"] == 3.0
|
|
|
|
|
|
@pytest.mark.asyncio
|
|
async def test_platform_auth_types_match_gs(client):
|
|
body = await (await client.get("/api/platforms")).get_json()
|
|
assert body["platforms"]["discord"]["auth_type"] == "token"
|
|
assert body["platforms"]["pixiv"]["auth_type"] == "token"
|
|
assert body["platforms"]["patreon"]["auth_type"] == "cookies"
|