chore: resolve integration diagnostics

This commit is contained in:
Jeffrey (Dongkyu) Kim 2026-05-31 17:28:59 +09:00
commit e336f7898c
2 changed files with 13 additions and 6 deletions

View file

@ -160,8 +160,8 @@ def check_dependencies(*, launch_browser: bool = True) -> None:
if sys.version_info < (3, 9):
raise SystemExit("python 3.9+ is required")
try:
from playwright.sync_api import Error as PlaywrightError
from playwright.sync_api import sync_playwright
from playwright.sync_api import Error as PlaywrightError # type: ignore[reportMissingImports]
from playwright.sync_api import sync_playwright # type: ignore[reportMissingImports]
except ImportError as exc:
raise SystemExit(
"playwright is required. Install with: python3 -m pip install playwright"
@ -210,8 +210,8 @@ def save_session_cache(path: Path, session: Session) -> None:
def bootstrap_session(*, forest_id: str, forest_pw: str, ttl_sec: int = 600) -> Session:
try:
from playwright.sync_api import Error as PlaywrightError
from playwright.sync_api import sync_playwright
from playwright.sync_api import Error as PlaywrightError # type: ignore[reportMissingImports]
from playwright.sync_api import sync_playwright # type: ignore[reportMissingImports]
except ImportError as exc:
raise SystemExit(
"playwright is required. Install with: python3 -m pip install playwright "
@ -380,9 +380,12 @@ def fetch_one(
def is_available(row: dict[str, Any]) -> bool:
count_value = row.get("rsrvtCnt")
if count_value is None:
return False
try:
reserved_count = int(row.get("rsrvtCnt"))
except (TypeError, ValueError):
reserved_count = int(count_value)
except ValueError:
return False
return row.get("rsrvtAvail") == "Y" and reserved_count == 0

View file

@ -160,6 +160,7 @@ class TestStartupSupport(unittest.TestCase):
# 결과 확인
self.assertIsNotNone(result)
assert result is not None
self.assertEqual(result['title'], '서울시 청년 스타트업 창업 지원금')
@patch('startup_support.StartupSupportAPI._get_region_detail')
@ -173,6 +174,7 @@ class TestStartupSupport(unittest.TestCase):
# 결과 확인
self.assertIsNotNone(result)
assert result is not None
self.assertEqual(result['title'], '경기도 MVP 지원사업')
def test_parse_program_from_data_go_kr(self):
@ -198,6 +200,7 @@ class TestStartupSupport(unittest.TestCase):
# 결과 확인
self.assertIsNotNone(result)
assert result is not None
self.assertEqual(result['title'], '테스트 지원사업')
self.assertEqual(result['region'], '서울특별시')
self.assertEqual(result['support_type'], '보조금')
@ -226,6 +229,7 @@ class TestStartupSupport(unittest.TestCase):
# 결과 확인
self.assertIsNotNone(result)
assert result is not None
self.assertEqual(result['title'], '테스트 지원사업')
self.assertEqual(result['organization'], '경기도 창업진흥원')
self.assertEqual(result['support_type'], '융자')