mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-11-01 23:12:21 +00:00
* Fix plot look when using eval and add query to choices (#3881) * convert index to datetime and update choices * uncomment economy integration test * fix treasury concat bug * fix datasets concat on duplciates * Lock ruff version so that new lints dont break our CI (#3905) * Lock ruff version so that new lints dont break our CI * Bumped pre-commit ruff version * bump * Update release branch * revert conda yaml * logging hash * Update version number * Added scipy to intel * Add xgboost to intel * add scipy libs to windows only * add scipy sparse * update scipy and pywin * update tests * UPdate installation.md to reflect 2.2 * fix yf unit tests * Try to get futures tests working * Ignore tz in yf download * Found another end date needed * delelte yf cache Co-authored-by: montezdesousa <79287829+montezdesousa@users.noreply.github.com> Co-authored-by: Colin Delahunty <72827203+colin99d@users.noreply.github.com> Co-authored-by: Chavithra PARANA <chavithra@gmail.com> Co-authored-by: luqazino@gmail.com <luqazino@gmail.com> Co-authored-by: hjoaquim <h.joaquim@campus.fct.unl.pt>
61 lines
1.1 KiB
Python
61 lines
1.1 KiB
Python
# IMPORTATION STANDARD
|
|
|
|
# IMPORTATION THIRDPARTY
|
|
import pytest
|
|
|
|
# IMPORTATION INTERNAL
|
|
from openbb_terminal.futures import yfinance_model
|
|
|
|
|
|
@pytest.fixture(scope="module")
|
|
def vcr_config():
|
|
return {
|
|
"filter_headers": [("User-Agent", None)],
|
|
"filter_query_parameters": [
|
|
("period1", "MOCK_PERIOD_1"),
|
|
("period2", "MOCK_PERIOD_2"),
|
|
],
|
|
}
|
|
|
|
|
|
@pytest.mark.vcr
|
|
@pytest.mark.parametrize(
|
|
"category",
|
|
[
|
|
"agriculture",
|
|
"metals",
|
|
],
|
|
)
|
|
def test_get_search_futures(recorder, category):
|
|
result = yfinance_model.get_search_futures(category)
|
|
|
|
recorder.capture(result)
|
|
|
|
|
|
@pytest.mark.vcr
|
|
@pytest.mark.parametrize(
|
|
"symbols",
|
|
[
|
|
["BLK"],
|
|
],
|
|
)
|
|
def test_get_historical_futures(recorder, symbols):
|
|
result = yfinance_model.get_historical_futures(
|
|
symbols, start_date="2022-01-01", end_date="2023-01-01"
|
|
)
|
|
|
|
recorder.capture(result)
|
|
|
|
|
|
@pytest.mark.vcr
|
|
@pytest.mark.parametrize(
|
|
"symbol",
|
|
[
|
|
["ES"],
|
|
],
|
|
)
|
|
def test_get_curve_futures(recorder, symbol):
|
|
result = yfinance_model.get_curve_futures(symbol)
|
|
|
|
recorder.capture(result)
|