feat: 로딩 스켈레톤·행사 사진·전시·주말 예상 점수·노을 탭 재정리 등 화면 전반 개선
- 화면 전체 스켈레톤, 로딩·완료·실패 사이 레이아웃 고정, 값 없음은 '?' - 행사 사진·출처 표시, 문화정보 API 전시 연결, 행사 30km 거리 기준 - 각 상세 점수 칸 오늘/내일/토/일, 단기예보 밖 주말은 중기예보 예상 점수 - 6각 차트 축 이름을 좋은 방향으로, 계산 근거 문구 정리 - 아이콘 오용·뜻 모를 표시·빈 데이터·포스트 본문 반복 수정 - 미세먼지 별도 포스트, 노을 명소 전국 155곳 거리 기준, 노을 탭 결론 중심 재구성 - 밤 다크 테마·별똥별, 댓글·좋아요 대기·실패 표시 - 주말 전국 랭킹·당일치기 카드, 계절 이야기 사진 수집 - 문서: 포스트 타입별 내용, 각 데이터 정리, TODO 진행 순서
This commit is contained in:
1 parent
296a09d6db
commit
ddf05aeb5c
97 files changed
+5475
-720
No files matched your search
@@ -0,0 +1,49 @@
|
||||
import pytest
|
||||
from httpx import ASGITransport, AsyncClient
|
||||
|
||||
import services.air_service as air_service
|
||||
import services.now_service as now_service
|
||||
import services.season_service as season_service
|
||||
import services.sky_service as sky_service
|
||||
import services.warning_service as warning_service
|
||||
import services.weather_service as weather_service
|
||||
import services.week_service as week_service
|
||||
from router.router import app
|
||||
from services.external.data_go_kr import DataGoKrRequestFailed
|
||||
from services.external.open_meteo import OpenMeteoRequestFailed
|
||||
|
||||
REGION = "1114000000"
|
||||
ENDPOINTS = ["/v1/feed", "/v1/weather/today", "/v1/weather/now", "/v1/sky", "/v1/week", "/v1/index/list", "/v1/season/week"]
|
||||
SOURCES = {
|
||||
"vilage": (weather_service, "fetch_vilage", DataGoKrRequestFailed),
|
||||
"ultra": (now_service, "fetch_ultra", DataGoKrRequestFailed),
|
||||
"air": (air_service, "fetch_realtime", DataGoKrRequestFailed),
|
||||
"warning": (warning_service, "fetch_warning_events", DataGoKrRequestFailed),
|
||||
"clouds": (sky_service, "fetch_clouds", OpenMeteoRequestFailed),
|
||||
"mid": (weather_service, "fetch_mid", DataGoKrRequestFailed),
|
||||
"holiday": (week_service, "fetch_holidays", DataGoKrRequestFailed),
|
||||
"festival": (week_service, "fetch_festivals", DataGoKrRequestFailed),
|
||||
"solar_term": (season_service, "fetch_solar_terms", DataGoKrRequestFailed),
|
||||
}
|
||||
|
||||
|
||||
def _break(monkeypatch, source: str, mode: str) -> None:
|
||||
module, name, exc = SOURCES[source]
|
||||
|
||||
async def fail(*_a, **_k):
|
||||
raise exc(f"{source} down")
|
||||
|
||||
async def empty(*_a, **_k):
|
||||
return ({}, {}) if source == "mid" else []
|
||||
|
||||
monkeypatch.setattr(module, name, {"fail": fail, "empty": empty}[mode])
|
||||
|
||||
|
||||
@pytest.mark.anyio
|
||||
@pytest.mark.parametrize("mode", ["fail", "empty"])
|
||||
@pytest.mark.parametrize("source", list(SOURCES))
|
||||
async def test_every_screen_survives_one_broken_source(offline, monkeypatch, source, mode):
|
||||
_break(monkeypatch, source, mode)
|
||||
async with AsyncClient(transport=ASGITransport(app=app), base_url="http://test") as client:
|
||||
codes = {path: (await client.get(path, params={"region": REGION})).status_code for path in ENDPOINTS}
|
||||
assert all(c == 200 for c in codes.values()), codes
|
||||
Reference in new issue
Block a user