mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-11-12 12:22:35 +00:00
feature/cboe-async: Refactor Cboe for Async (#5900)
* refactor cboe for async * codespell * unused imports * pylint * more pylint * platform metadata * classmethod decorator * test params * intrinio quote * test param names * date in test needs to be a datetime.date not string * make fmp unix timestamp tz-aware and normalize percent change * different way of parsing datetime string * recapture cboe equity historical test * unused import * index snapshot update * black * extension map * pylint * cboe pyproject.toml * proposal to standardize equity_quote * one more file * removing changes on static assets * index_historical * index_historical again * last_time -> last_timestamp * obsolete router path * fix tests * test param * restore market index deprecation that I forgot about * fixing tests --------- Co-authored-by: hjoaquim <h.joaquim@campus.fct.unl.pt>
This commit is contained in:
@@ -21,7 +21,8 @@ def obb(pytestconfig): # pylint: disable=inconsistent-return-statements
|
||||
@parametrize(
|
||||
"params",
|
||||
[
|
||||
({"index": "dowjones"}),
|
||||
({"index": "dowjones", "provider": "fmp"}),
|
||||
({"index": "BUKBUS", "provider": "cboe"}),
|
||||
],
|
||||
)
|
||||
@pytest.mark.integration
|
||||
@@ -35,123 +36,6 @@ def test_index_constituents(params, obb):
|
||||
@parametrize(
|
||||
"params",
|
||||
[
|
||||
(
|
||||
{
|
||||
"symbol": "AAVE100",
|
||||
"start_date": "2023-01-01",
|
||||
"end_date": "2023-06-06",
|
||||
}
|
||||
),
|
||||
(
|
||||
{
|
||||
"interval": "1m",
|
||||
"provider": "cboe",
|
||||
"symbol": "AAVE100",
|
||||
"start_date": "2023-01-01",
|
||||
"end_date": "2023-06-06",
|
||||
}
|
||||
),
|
||||
(
|
||||
{
|
||||
"interval": "1d",
|
||||
"provider": "cboe",
|
||||
"symbol": "AAVE100",
|
||||
"start_date": "2023-01-01",
|
||||
"end_date": "2023-06-06",
|
||||
}
|
||||
),
|
||||
(
|
||||
{
|
||||
"interval": "1min",
|
||||
"provider": "fmp",
|
||||
"symbol": "^DJI",
|
||||
"start_date": "2023-01-01",
|
||||
"end_date": "2023-06-06",
|
||||
"timeseries": 1,
|
||||
"sort": "desc",
|
||||
}
|
||||
),
|
||||
(
|
||||
{
|
||||
"interval": "1day",
|
||||
"provider": "fmp",
|
||||
"symbol": "^DJI",
|
||||
"start_date": "2023-01-01",
|
||||
"end_date": "2023-06-06",
|
||||
"timeseries": 1,
|
||||
"sort": "desc",
|
||||
}
|
||||
),
|
||||
(
|
||||
{
|
||||
"timespan": "minute",
|
||||
"sort": "desc",
|
||||
"limit": 49999,
|
||||
"adjusted": True,
|
||||
"multiplier": 1,
|
||||
"provider": "polygon",
|
||||
"symbol": "NDX",
|
||||
"start_date": "2023-01-01",
|
||||
"end_date": "2023-06-06",
|
||||
}
|
||||
),
|
||||
(
|
||||
{
|
||||
"timespan": "day",
|
||||
"sort": "desc",
|
||||
"limit": 49999,
|
||||
"adjusted": True,
|
||||
"multiplier": 1,
|
||||
"provider": "polygon",
|
||||
"symbol": "NDX",
|
||||
"start_date": "2023-01-01",
|
||||
"end_date": "2023-06-06",
|
||||
}
|
||||
),
|
||||
(
|
||||
{
|
||||
"interval": "1d",
|
||||
"period": "max",
|
||||
"prepost": True,
|
||||
"rounding": True,
|
||||
"provider": "yfinance",
|
||||
"symbol": "DJI",
|
||||
"start_date": "2023-01-01",
|
||||
"end_date": "2023-06-06",
|
||||
}
|
||||
),
|
||||
(
|
||||
{
|
||||
"provider": "intrinio",
|
||||
"start_date": "2023-01-01",
|
||||
"end_date": "2023-06-06",
|
||||
"symbol": "$DJI",
|
||||
"tag": "level",
|
||||
"sort": "desc",
|
||||
"limit": 100,
|
||||
"type": None,
|
||||
}
|
||||
),
|
||||
],
|
||||
)
|
||||
@pytest.mark.integration
|
||||
def test_index_market(params, obb):
|
||||
result = obb.index.market(**params)
|
||||
assert result
|
||||
assert isinstance(result, OBBject)
|
||||
assert len(result.results) > 0
|
||||
|
||||
|
||||
@parametrize(
|
||||
"params",
|
||||
[
|
||||
(
|
||||
{
|
||||
"symbol": "AAVE100",
|
||||
"start_date": "2023-01-01",
|
||||
"end_date": "2023-06-06",
|
||||
}
|
||||
),
|
||||
(
|
||||
{
|
||||
"interval": "1m",
|
||||
@@ -159,6 +43,7 @@ def test_index_market(params, obb):
|
||||
"symbol": "AAVE100",
|
||||
"start_date": "2023-01-01",
|
||||
"end_date": "2023-06-06",
|
||||
"use_cache": False,
|
||||
}
|
||||
),
|
||||
(
|
||||
@@ -168,6 +53,7 @@ def test_index_market(params, obb):
|
||||
"symbol": "AAVE100",
|
||||
"start_date": "2023-01-01",
|
||||
"end_date": "2023-06-06",
|
||||
"use_cache": False,
|
||||
}
|
||||
),
|
||||
(
|
||||
@@ -257,7 +143,7 @@ def test_index_price_historical(params, obb):
|
||||
[
|
||||
(
|
||||
{
|
||||
"symbol": "BUKBUS",
|
||||
"symbol": "AAVE100",
|
||||
"start_date": "2023-01-01",
|
||||
"end_date": "2023-06-06",
|
||||
}
|
||||
@@ -266,7 +152,66 @@ def test_index_price_historical(params, obb):
|
||||
{
|
||||
"interval": "1m",
|
||||
"provider": "cboe",
|
||||
"symbol": "BUKBUS",
|
||||
"symbol": "AAVE100",
|
||||
"start_date": "2023-01-01",
|
||||
"end_date": "2023-06-06",
|
||||
"use_cache": True,
|
||||
}
|
||||
),
|
||||
(
|
||||
{
|
||||
"interval": "1d",
|
||||
"provider": "cboe",
|
||||
"symbol": "AAVE100",
|
||||
"start_date": "2023-01-01",
|
||||
"end_date": "2023-06-06",
|
||||
"use_cache": False,
|
||||
}
|
||||
),
|
||||
(
|
||||
{
|
||||
"interval": "1min",
|
||||
"provider": "fmp",
|
||||
"symbol": "^DJI",
|
||||
"start_date": "2023-01-01",
|
||||
"end_date": "2023-06-06",
|
||||
"timeseries": 1,
|
||||
"sort": "desc",
|
||||
}
|
||||
),
|
||||
(
|
||||
{
|
||||
"interval": "1day",
|
||||
"provider": "fmp",
|
||||
"symbol": "^DJI",
|
||||
"start_date": "2023-01-01",
|
||||
"end_date": "2023-06-06",
|
||||
"timeseries": 1,
|
||||
"sort": "desc",
|
||||
}
|
||||
),
|
||||
(
|
||||
{
|
||||
"timespan": "minute",
|
||||
"sort": "desc",
|
||||
"limit": 49999,
|
||||
"adjusted": True,
|
||||
"multiplier": 1,
|
||||
"provider": "polygon",
|
||||
"symbol": "NDX",
|
||||
"start_date": "2023-01-01",
|
||||
"end_date": "2023-06-06",
|
||||
}
|
||||
),
|
||||
(
|
||||
{
|
||||
"timespan": "day",
|
||||
"sort": "desc",
|
||||
"limit": 49999,
|
||||
"adjusted": True,
|
||||
"multiplier": 1,
|
||||
"provider": "polygon",
|
||||
"symbol": "NDX",
|
||||
"start_date": "2023-01-01",
|
||||
"end_date": "2023-06-06",
|
||||
}
|
||||
@@ -274,31 +219,32 @@ def test_index_price_historical(params, obb):
|
||||
(
|
||||
{
|
||||
"interval": "1d",
|
||||
"provider": "cboe",
|
||||
"symbol": "BUKBUS",
|
||||
"period": "max",
|
||||
"prepost": True,
|
||||
"rounding": True,
|
||||
"provider": "yfinance",
|
||||
"symbol": "DJI",
|
||||
"start_date": "2023-01-01",
|
||||
"end_date": "2023-06-06",
|
||||
}
|
||||
),
|
||||
(
|
||||
{
|
||||
"provider": "intrinio",
|
||||
"start_date": "2023-01-01",
|
||||
"end_date": "2023-06-06",
|
||||
"symbol": "$DJI",
|
||||
"tag": "level",
|
||||
"sort": "desc",
|
||||
"limit": 100,
|
||||
"type": None,
|
||||
}
|
||||
),
|
||||
],
|
||||
)
|
||||
@pytest.mark.integration
|
||||
def test_index_european(params, obb):
|
||||
result = obb.index.european(**params)
|
||||
assert result
|
||||
assert isinstance(result, OBBject)
|
||||
assert len(result.results) > 0
|
||||
|
||||
|
||||
@parametrize(
|
||||
"params",
|
||||
[
|
||||
({"symbol": "BUKBUS", "provider": "cboe"}),
|
||||
],
|
||||
)
|
||||
@pytest.mark.integration
|
||||
def test_index_european_constituents(params, obb):
|
||||
result = obb.index.european_constituents(**params)
|
||||
def test_index_market(params, obb):
|
||||
result = obb.index.market(**params)
|
||||
assert result
|
||||
assert isinstance(result, OBBject)
|
||||
assert len(result.results) > 0
|
||||
@@ -308,7 +254,7 @@ def test_index_european_constituents(params, obb):
|
||||
"params",
|
||||
[
|
||||
({}),
|
||||
({"europe": True, "provider": "cboe"}),
|
||||
({"provider": "cboe", "use_cache": False}),
|
||||
({"provider": "fmp"}),
|
||||
({"provider": "yfinance"}),
|
||||
],
|
||||
@@ -324,8 +270,7 @@ def test_index_available(params, obb):
|
||||
@parametrize(
|
||||
"params",
|
||||
[
|
||||
({"query": "D", "is_symbol": True}),
|
||||
({"europe": True, "provider": "cboe", "query": "A", "is_symbol": False}),
|
||||
({"query": "D", "is_symbol": True, "use_cache": False, "provider": "cboe"}),
|
||||
],
|
||||
)
|
||||
@pytest.mark.integration
|
||||
@@ -339,7 +284,7 @@ def test_index_search(params, obb):
|
||||
@parametrize(
|
||||
"params",
|
||||
[
|
||||
({"region": "US"}),
|
||||
({"region": "us", "provider": "cboe"}),
|
||||
],
|
||||
)
|
||||
@pytest.mark.integration
|
||||
|
||||
Reference in New Issue
Block a user