Files
OpenBB/tests/openbb_terminal/futures/test_yfinance_model.py
James Maslek f7d63fa499 Adding some test coverage (#3316)
* Fix the formatting test by changing futures input to symbol not ticker

* Regenerate sdk docs

* Add test for economy macro

* fred query test

* Futures

* FRED Test

* lint

* flake fix

* black fix

* futures again

* Test Index

* Add treasury tests

* pylint ignore too many lines

* FOrgot end date
2022-11-09 15:52:20 -05:00

59 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)
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)