From 3b2494022d154a3f1e301ff86c33065c6553699f Mon Sep 17 00:00:00 2001 From: David Jeong Date: Sun, 3 Apr 2022 12:16:33 +0900 Subject: [PATCH] =?UTF-8?q?get=5Ftickers=EC=97=90=20is=5Fdetail=3DTrue?= =?UTF-8?q?=EC=9D=B4=EB=A9=B4=20verbose=3DTrue=EB=A1=9C=20=EC=B7=A8?= =?UTF-8?q?=EA=B8=89(#36)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pyupbit/quotation_api.py | 2 +- tests/test_quotation_api.py | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/pyupbit/quotation_api.py b/pyupbit/quotation_api.py index 5fcc065..bef0e8b 100644 --- a/pyupbit/quotation_api.py +++ b/pyupbit/quotation_api.py @@ -26,7 +26,7 @@ def get_tickers(fiat="", is_details=False, limit_info=False, verbose=False): detail = "true" if is_details else "false" markets, req_limit_info = _call_public_api(url, isDetails=detail) - if verbose: + if verbose or is_details: tickers = [x for x in markets if x['market'].startswith(fiat)] else: tickers = [x['market'] for x in markets if x['market'].startswith(fiat)] diff --git a/tests/test_quotation_api.py b/tests/test_quotation_api.py index ca6c749..4a52e29 100644 --- a/tests/test_quotation_api.py +++ b/tests/test_quotation_api.py @@ -24,6 +24,12 @@ def test_get_tickers_with_limit_info(): assert isinstance(limit_info, dict) +def test_get_tickers_with_market_warning(): + tickers = get_tickers(is_details=True) + for ticker in tickers: + assert ticker["market_warning"] in ["NONE", "CAUTION"] + + def test_get_ohlcv_defaults(): resp = get_ohlcv() assert isinstance(resp, pd.DataFrame)