From 7aa727b4df6b7a816b29e1126efed27040089079 Mon Sep 17 00:00:00 2001 From: David Jeong Date: Sun, 3 Apr 2022 12:16:33 +0900 Subject: [PATCH 1/3] fix get_tickers to treat is_detail=True as also verbose=True (#36) --- 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) From 708ecfdb32dd7a5c6dc8f82d82884a7a1e1dc886 Mon Sep 17 00:00:00 2001 From: David Jeong Date: Sun, 3 Apr 2022 12:22:52 +0900 Subject: [PATCH 2/3] add automation with actions and dependabot --- .github/dependabot.yml | 6 ++++++ .github/workflows/pytest.yml | 27 +++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/pytest.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..8d20e2e --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: pip + directory: / + schedule: + interval: daily diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml new file mode 100644 index 0000000..4ead6fc --- /dev/null +++ b/.github/workflows/pytest.yml @@ -0,0 +1,27 @@ +name: Run All Tests + +on: + push: + branches: [master] + pull_request: + branches: [master] + +jobs: + pytest: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - name: Set up Python + uses: actions/setup-python@master + with: + python-version: '3.9' + - name: Install Dependencies + run: | + python -m pip install -U pip wheel + pip install -r requirements.txt + - name: Run All Tests + run: | + pip install pytest + pytest + env: + PYTHONPATH: .:$PYTHONPATH From 4c4271b020f8524ce7ffb36b074698c442dffdda Mon Sep 17 00:00:00 2001 From: David Jeong Date: Sun, 3 Apr 2022 13:54:55 +0900 Subject: [PATCH 3/3] add timezone to GitHub actions --- .github/workflows/pytest.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 4ead6fc..f60ae82 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -10,6 +10,9 @@ jobs: pytest: runs-on: ubuntu-latest steps: + - uses: szenius/set-timezone@v1.0 + with: + timezoneLinux: "Asia/Seoul" - uses: actions/checkout@master - name: Set up Python uses: actions/setup-python@master