Skip to content

Commit

Permalink
get_tickers에 is_detail=True이면 verbose=True로 취급(sharebook-kr#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
David Jeong committed Apr 3, 2022
1 parent 17abbe8 commit 3b24940
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pyupbit/quotation_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
6 changes: 6 additions & 0 deletions tests/test_quotation_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 3b24940

Please sign in to comment.