Skip to content

Commit c8c677b

Browse files
gylimclaude
authored andcommitted
chore: 녹화 스크립트를 tests/로 이동 및 CLAUDE.md 갱신
- scripts/record_order_cassettes.py → tests/record_order_cassettes.py - sys.path 해킹 및 noqa 주석 제거 - CLAUDE.md에 VCR cassette 녹화 가이드, before_record_response 주의사항 추가 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 1084c7d commit c8c677b

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

CLAUDE.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,18 @@ IMPORTANT: `pip`을 직접 사용하지 않는다. 모든 의존성 관리와
3333
- `_protocols.py` — 공유 클라이언트 프로토콜 (shortcuts/strategies 양쪽에서 사용)
3434
- `_auth.py` — JWT(HS512) 인증
3535
- `_http.py` — HTTP 레이어 (재시도, 레이트 리밋)
36-
- `tests/` — src/ 구조를 미러링
36+
- `tests/` — src/ 구조를 미러링, cassette 녹화 스크립트 포함
3737
- `specs/` — API 스펙 (OpenAPI 3.1 + AsyncAPI 3.0)
3838

3939
## 테스트
4040

4141
- pytest + pytest-asyncio 사용
4242
- HTTP 모킹은 vcrpy (cassette 방식)
4343
- 테스트 파일은 src/ 디렉토리 구조를 따른다
44+
- VCR cassette 녹화: `VCR_RECORD_MODE=all uv run pytest tests/api/test_*_vcr.py`
45+
- Exchange API는 `UPBIT_ACCESS_KEY`, `UPBIT_SECRET_KEY` 환경변수 필요
46+
- 시장가 주문 cassette은 별도 스크립트: `tests/record_order_cassettes.py`
47+
- `tests/_vcr.py``before_record_response` 훅은 리플레이 시에도 호출되므로 body 변환 로직에 주의
4448

4549
## LSP
4650

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
66
사용법:
77
UPBIT_ACCESS_KEY=xxx UPBIT_SECRET_KEY=yyy \
8-
uv run python scripts/record_order_cassettes.py
8+
uv run python tests/record_order_cassettes.py
99
"""
1010

1111
from __future__ import annotations
@@ -14,12 +14,8 @@
1414
import sys
1515
import time
1616

17-
# 프로젝트 루트의 tests 모듈을 import하기 위해 경로 추가
18-
sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
19-
20-
from tests._vcr import upbeat_vcr # noqa: E402
21-
22-
from upbeat import Upbeat # noqa: E402
17+
from tests._vcr import upbeat_vcr
18+
from upbeat import Upbeat
2319

2420
_MARKET = "KRW-BTC"
2521
_BUY_AMOUNT = "10000" # 매도 시 최소금액(5000원) 확보를 위해 넉넉히

0 commit comments

Comments
 (0)