File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed
Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change 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
1111from __future__ import annotations
1414import sys
1515import 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원) 확보를 위해 넉넉히
You can’t perform that action at this time.
0 commit comments