mirror of
https://github.com/NomaDamas/k-skill.git
synced 2026-06-24 02:04:11 +00:00
chore: resolve integration diagnostics
This commit is contained in:
parent
352876f915
commit
e336f7898c
2 changed files with 13 additions and 6 deletions
|
|
@ -160,8 +160,8 @@ def check_dependencies(*, launch_browser: bool = True) -> None:
|
||||||
if sys.version_info < (3, 9):
|
if sys.version_info < (3, 9):
|
||||||
raise SystemExit("python 3.9+ is required")
|
raise SystemExit("python 3.9+ is required")
|
||||||
try:
|
try:
|
||||||
from playwright.sync_api import Error as PlaywrightError
|
from playwright.sync_api import Error as PlaywrightError # type: ignore[reportMissingImports]
|
||||||
from playwright.sync_api import sync_playwright
|
from playwright.sync_api import sync_playwright # type: ignore[reportMissingImports]
|
||||||
except ImportError as exc:
|
except ImportError as exc:
|
||||||
raise SystemExit(
|
raise SystemExit(
|
||||||
"playwright is required. Install with: python3 -m pip install playwright"
|
"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:
|
def bootstrap_session(*, forest_id: str, forest_pw: str, ttl_sec: int = 600) -> Session:
|
||||||
try:
|
try:
|
||||||
from playwright.sync_api import Error as PlaywrightError
|
from playwright.sync_api import Error as PlaywrightError # type: ignore[reportMissingImports]
|
||||||
from playwright.sync_api import sync_playwright
|
from playwright.sync_api import sync_playwright # type: ignore[reportMissingImports]
|
||||||
except ImportError as exc:
|
except ImportError as exc:
|
||||||
raise SystemExit(
|
raise SystemExit(
|
||||||
"playwright is required. Install with: python3 -m pip install playwright "
|
"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:
|
def is_available(row: dict[str, Any]) -> bool:
|
||||||
|
count_value = row.get("rsrvtCnt")
|
||||||
|
if count_value is None:
|
||||||
|
return False
|
||||||
try:
|
try:
|
||||||
reserved_count = int(row.get("rsrvtCnt"))
|
reserved_count = int(count_value)
|
||||||
except (TypeError, ValueError):
|
except ValueError:
|
||||||
return False
|
return False
|
||||||
return row.get("rsrvtAvail") == "Y" and reserved_count == 0
|
return row.get("rsrvtAvail") == "Y" and reserved_count == 0
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -160,6 +160,7 @@ class TestStartupSupport(unittest.TestCase):
|
||||||
|
|
||||||
# 결과 확인
|
# 결과 확인
|
||||||
self.assertIsNotNone(result)
|
self.assertIsNotNone(result)
|
||||||
|
assert result is not None
|
||||||
self.assertEqual(result['title'], '서울시 청년 스타트업 창업 지원금')
|
self.assertEqual(result['title'], '서울시 청년 스타트업 창업 지원금')
|
||||||
|
|
||||||
@patch('startup_support.StartupSupportAPI._get_region_detail')
|
@patch('startup_support.StartupSupportAPI._get_region_detail')
|
||||||
|
|
@ -173,6 +174,7 @@ class TestStartupSupport(unittest.TestCase):
|
||||||
|
|
||||||
# 결과 확인
|
# 결과 확인
|
||||||
self.assertIsNotNone(result)
|
self.assertIsNotNone(result)
|
||||||
|
assert result is not None
|
||||||
self.assertEqual(result['title'], '경기도 MVP 지원사업')
|
self.assertEqual(result['title'], '경기도 MVP 지원사업')
|
||||||
|
|
||||||
def test_parse_program_from_data_go_kr(self):
|
def test_parse_program_from_data_go_kr(self):
|
||||||
|
|
@ -198,6 +200,7 @@ class TestStartupSupport(unittest.TestCase):
|
||||||
|
|
||||||
# 결과 확인
|
# 결과 확인
|
||||||
self.assertIsNotNone(result)
|
self.assertIsNotNone(result)
|
||||||
|
assert result is not None
|
||||||
self.assertEqual(result['title'], '테스트 지원사업')
|
self.assertEqual(result['title'], '테스트 지원사업')
|
||||||
self.assertEqual(result['region'], '서울특별시')
|
self.assertEqual(result['region'], '서울특별시')
|
||||||
self.assertEqual(result['support_type'], '보조금')
|
self.assertEqual(result['support_type'], '보조금')
|
||||||
|
|
@ -226,6 +229,7 @@ class TestStartupSupport(unittest.TestCase):
|
||||||
|
|
||||||
# 결과 확인
|
# 결과 확인
|
||||||
self.assertIsNotNone(result)
|
self.assertIsNotNone(result)
|
||||||
|
assert result is not None
|
||||||
self.assertEqual(result['title'], '테스트 지원사업')
|
self.assertEqual(result['title'], '테스트 지원사업')
|
||||||
self.assertEqual(result['organization'], '경기도 창업진흥원')
|
self.assertEqual(result['organization'], '경기도 창업진흥원')
|
||||||
self.assertEqual(result['support_type'], '융자')
|
self.assertEqual(result['support_type'], '융자')
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue