테스트 강화 및 코드 품질 개선

This commit is contained in:
2025-12-17 00:01:46 +09:00
parent 37a150bd0d
commit 00c57ddd32
51 changed files with 10670 additions and 217 deletions

View File

@@ -41,7 +41,7 @@ class TestPlaceBuyOrderValidation:
assert result["status"] == "simulated"
assert result["market"] == "KRW-BTC"
assert result["amount_krw"] == 100000
assert result["amount_krw"] == 99950.0
def test_buy_order_below_min_amount(self):
"""Test buy order rejected for amount below minimum."""
@@ -172,7 +172,8 @@ class TestBuyOrderResponseValidation:
mock_upbit.buy_limit_order.return_value = "invalid_response"
with patch("src.order.adjust_price_to_tick_size", return_value=50000000):
result = place_buy_order_upbit("KRW-BTC", 100000, cfg)
with patch("src.common.krw_budget_manager.allocate", return_value=(True, 100000, "tok")):
result = place_buy_order_upbit("KRW-BTC", 100000, cfg)
assert result["status"] == "failed"
assert result["error"] == "invalid_response_type"
@@ -195,7 +196,8 @@ class TestBuyOrderResponseValidation:
}
with patch("src.order.adjust_price_to_tick_size", return_value=50000000):
result = place_buy_order_upbit("KRW-BTC", 100000, cfg)
with patch("src.common.krw_budget_manager.allocate", return_value=(True, 100000, "tok")):
result = place_buy_order_upbit("KRW-BTC", 100000, cfg)
assert result["status"] == "failed"
assert result["error"] == "order_rejected"