chore: test_v2_16drugs.py _dev_scripts로 이동 (추적 제거)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
청춘약국
2026-04-06 18:30:31 +09:00
parent dab2ecae44
commit 6b3be6da9a

View File

@@ -1,74 +0,0 @@
# -*- coding: utf-8 -*-
"""
v2 API 테스트 - 16개 약품 (4페이지)
"""
import os
import sys
sys.path.insert(0, os.path.dirname(__file__))
from animal_med import AnimalMedRendererV2
def main():
print("=" * 60)
print("v2 API 테스트 - 16개 약품 (4페이지)")
print("=" * 60)
renderer = AnimalMedRendererV2()
# 마스터 약품 목록
print("\n[1] 마스터 약품 목록:")
drugs = renderer.list_drugs()
for drug in drugs:
print(f" {drug['product_id']} - {drug['name']} ({drug['category']})")
print(f"\n{len(drugs)}개 약품")
# 16개 약품 사용 (2x2 x 4페이지)
test_ids = [
"MASTER-001", "MASTER-002", "MASTER-003", "MASTER-004",
"MASTER-005", "MASTER-006", "MASTER-007", "MASTER-008",
"MASTER-010", "MASTER-011", "MASTER-012", "MASTER-013",
"MASTER-014", "MASTER-015", "MASTER-016", "MASTER-009"
]
print(f"\n[2] PDF 렌더링 ({len(test_ids)}개 약품)")
# PDF 생성
output_dir = os.path.join(os.path.dirname(__file__), 'output')
os.makedirs(output_dir, exist_ok=True)
pdf_path = os.path.join(output_dir, 'v2_16drugs_4pages.pdf')
print(f"\n[3] PDF 생성 중...")
result = renderer.render_to_pdf(
product_ids=test_ids,
output_path=pdf_path,
patient_name="김보호자",
pet_name="뽀삐",
pet_species="푸들",
pet_age="3세"
)
if result['success']:
print(f" ✅ 성공!")
print(f" 📄 PDF: {result['pdf_path']}")
print(f" 약품: {len(result['drugs'])}")
size = os.path.getsize(pdf_path)
print(f" 크기: {size / 1024:.1f} KB")
import fitz
doc = fitz.open(pdf_path)
print(f" 페이지 수: {len(doc)}")
doc.close()
else:
print(f" ❌ 실패: {result.get('error')}")
print("\n" + "=" * 60)
if __name__ == "__main__":
main()