Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename etf discovery #5715

Merged
merged 1 commit into from
Nov 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions openbb_platform/extensions/etf/integration/test_etf_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,11 +196,11 @@ def test_etf_countries(params, headers):
[({"sort": "desc", "limit": 10})],
)
@pytest.mark.integration
def test_etf_disc_gainers(params, headers):
def test_etf_discovery_gainers(params, headers):
params = {p: v for p, v in params.items() if v}

query_str = get_querystring(params, [])
url = f"http://0.0.0.0:8000/api/v1/etf/disc/gainers?{query_str}"
url = f"http://0.0.0.0:8000/api/v1/etf/discovery/gainers?{query_str}"
result = requests.get(url, headers=headers, timeout=10)
assert isinstance(result, requests.Response)
assert result.status_code == 200
Expand All @@ -211,11 +211,11 @@ def test_etf_disc_gainers(params, headers):
[({"sort": "desc", "limit": 10})],
)
@pytest.mark.integration
def test_etf_disc_losers(params, headers):
def test_etf_discovery_losers(params, headers):
params = {p: v for p, v in params.items() if v}

query_str = get_querystring(params, [])
url = f"http://0.0.0.0:8000/api/v1/etf/disc/losers?{query_str}"
url = f"http://0.0.0.0:8000/api/v1/etf/discovery/losers?{query_str}"
result = requests.get(url, headers=headers, timeout=10)
assert isinstance(result, requests.Response)
assert result.status_code == 200
Expand All @@ -226,11 +226,11 @@ def test_etf_disc_losers(params, headers):
[({"sort": "desc", "limit": 10})],
)
@pytest.mark.integration
def test_etf_disc_active(params, headers):
def test_etf_discovery_active(params, headers):
params = {p: v for p, v in params.items() if v}

query_str = get_querystring(params, [])
url = f"http://0.0.0.0:8000/api/v1/etf/disc/active?{query_str}"
url = f"http://0.0.0.0:8000/api/v1/etf/discovery/active?{query_str}"
result = requests.get(url, headers=headers, timeout=10)
assert isinstance(result, requests.Response)
assert result.status_code == 200
Expand Down
24 changes: 12 additions & 12 deletions openbb_platform/extensions/etf/integration/test_etf_python.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,10 @@ def test_etf_countries(params, obb):
[({"sort": "desc", "limit": 10})],
)
@pytest.mark.integration
def test_etf_disc_gainers(params, obb):
def test_etf_discovery_gainers(params, obb):
params = {p: v for p, v in params.items() if v}

result = obb.etf.disc.gainers(**params)
result = obb.etf.discovery.gainers(**params)
assert result
assert isinstance(result, OBBject)
assert len(result.results) > 0
Expand All @@ -200,10 +200,10 @@ def test_etf_disc_gainers(params, obb):
[({"sort": "desc", "limit": 10})],
)
@pytest.mark.integration
def test_etf_disc_losers(params, obb):
def test_etf_discovery_losers(params, obb):
params = {p: v for p, v in params.items() if v}

result = obb.etf.disc.losers(**params)
result = obb.etf.discovery.losers(**params)
assert result
assert isinstance(result, OBBject)
assert len(result.results) > 0
Expand All @@ -214,10 +214,10 @@ def test_etf_disc_losers(params, obb):
[({"sort": "desc", "limit": 10})],
)
@pytest.mark.integration
def test_etf_disc_active(params, obb):
def test_etf_discovery_active(params, obb):
params = {p: v for p, v in params.items() if v}

result = obb.etf.disc.active(**params)
result = obb.etf.discovery.active(**params)
assert result
assert isinstance(result, OBBject)
assert len(result.results) > 0
Expand Down Expand Up @@ -245,10 +245,10 @@ def test_etf_holdings_performance(params, obb):
[({"sort": "desc", "limit": 10})],
)
@pytest.mark.integration
def test_etf_disc_gainers2(params, obb):
def test_etf_discovery_gainers2(params, obb):
params = {p: v for p, v in params.items() if v}

result = obb.etf.disc.gainers(**params)
result = obb.etf.discovery.gainers(**params)
assert result
assert isinstance(result, OBBject)
assert len(result.results) > 0
Expand All @@ -259,10 +259,10 @@ def test_etf_disc_gainers2(params, obb):
[({"sort": "desc", "limit": 10})],
)
@pytest.mark.integration
def test_etf_disc_losers2(params, obb):
def test_etf_discovery_losers2(params, obb):
params = {p: v for p, v in params.items() if v}

result = obb.etf.disc.losers(**params)
result = obb.etf.discovery.losers(**params)
assert result
assert isinstance(result, OBBject)
assert len(result.results) > 0
Expand All @@ -273,10 +273,10 @@ def test_etf_disc_losers2(params, obb):
[({"sort": "desc", "limit": 10})],
)
@pytest.mark.integration
def test_etf_disc_active2(params, obb):
def test_etf_discovery_active2(params, obb):
params = {p: v for p, v in params.items() if v}

result = obb.etf.disc.active(**params)
result = obb.etf.discovery.active(**params)
assert result
assert isinstance(result, OBBject)
assert len(result.results) > 0
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""ETF Discovery."""
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
from openbb_core.app.router import Router
from pydantic import BaseModel

router = Router(prefix="/disc")
router = Router(prefix="/discovery")

# pylint: disable=unused-argument


@router.command(model="ETFGainers")
Expand Down
4 changes: 2 additions & 2 deletions openbb_platform/extensions/etf/openbb_etf/etf_router.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
from openbb_core.app.router import Router
from pydantic import BaseModel

from openbb_etf.disc.disc_router import router as disc_router
from openbb_etf.discovery.discovery_router import router as discovery_router

router = Router(prefix="")
router.include_router(disc_router)
router.include_router(discovery_router)

# pylint: disable=unused-argument

Expand Down
Loading