fix: dry-run mock KIS validation in workflows

This commit is contained in:
2026-06-21 23:22:22 +09:00
parent 610b9b1330
commit 3002149fce
8 changed files with 86 additions and 14 deletions
+7 -4
View File
@@ -50,6 +50,7 @@ def main() -> int:
ap = argparse.ArgumentParser(description="Validate KIS API credentials using the read-only quotations API.")
ap.add_argument("--account", choices=["mock", "real"], default="mock")
ap.add_argument("--ticker", default="005930")
ap.add_argument("--dry-run", action="store_true", help="Validate env wiring without calling the live KIS API.")
ap.add_argument("--output", type=Path, default=ROOT / "Temp" / "kis_api_credentials_validation_v1.json")
args = ap.parse_args()
@@ -87,10 +88,12 @@ def main() -> int:
errors.append("domain_mismatch")
if not evidence["env_match"]["app_key"] or not evidence["env_match"]["app_secret"]:
errors.append("selected_env_mismatch")
response = get_current_price(creds, args.ticker)
evidence["response_keys"] = sorted(response.keys())
if not isinstance(response, dict) or not response:
errors.append("empty_response")
evidence["dry_run"] = bool(args.dry_run)
if not args.dry_run:
response = get_current_price(creds, args.ticker)
evidence["response_keys"] = sorted(response.keys())
if not isinstance(response, dict) or not response:
errors.append("empty_response")
except Exception as exc: # noqa: BLE001
errors.append(str(exc))