Skip to content

Commit

Permalink
Merge pull request #72 from DrumRobot/master
Browse files Browse the repository at this point in the history
투자 유의 종목 필드 추가(#36) 반영 및 GitHub 자동화
  • Loading branch information
mr-yoo authored May 4, 2022
2 parents dfc2550 + 4c4271b commit 5dbba46
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: pip
directory: /
schedule:
interval: daily
30 changes: 30 additions & 0 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Run All Tests

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
pytest:
runs-on: ubuntu-latest
steps:
- uses: szenius/[email protected]
with:
timezoneLinux: "Asia/Seoul"
- 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
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 5dbba46

Please sign in to comment.