최초 프로젝트 업로드 (Script Auto Commit)
This commit is contained in:
41
test_run.py
Normal file
41
test_run.py
Normal file
@@ -0,0 +1,41 @@
|
||||
#!/usr/bin/env python
|
||||
"""간단한 실행 테스트 스크립트"""
|
||||
import os
|
||||
import sys
|
||||
from dotenv import load_dotenv
|
||||
|
||||
load_dotenv()
|
||||
|
||||
# 테스트용 환경변수 설정
|
||||
os.environ["DRY_RUN"] = "true"
|
||||
|
||||
from src.config import load_config, build_runtime_config
|
||||
from src.signals import process_symbol
|
||||
|
||||
|
||||
def test_process_symbol():
|
||||
"""process_symbol 함수 호출 테스트"""
|
||||
config = load_config()
|
||||
cfg = build_runtime_config(config)
|
||||
|
||||
# 테스트 심볼
|
||||
test_symbol = "KRW-BTC"
|
||||
|
||||
print(f"[테스트] {test_symbol} 처리 시작...")
|
||||
try:
|
||||
# 실제 호출 형태 (threading_utils에서 사용하는 방식)
|
||||
result = process_symbol(test_symbol, cfg=cfg)
|
||||
print(f"[성공] 결과: {result.get('symbol')} - 오류: {result.get('error')}")
|
||||
print(f"[요약] {result.get('summary', [])[:3]}")
|
||||
return True
|
||||
except Exception as e:
|
||||
print(f"[실패] 오류 발생: {e}")
|
||||
import traceback
|
||||
|
||||
traceback.print_exc()
|
||||
return False
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
success = test_process_symbol()
|
||||
sys.exit(0 if success else 1)
|
||||
Reference in New Issue
Block a user