mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-11-28 12:13:11 +00:00
* Add polygon to fundamentals * Update fa menu text * Update fa menu text * tests for _model * wording/lint * _view tests Co-authored-by: didierlopes.eth <dro.lopes@campus.fct.unl.pt>
50 lines
1.3 KiB
Python
50 lines
1.3 KiB
Python
# IMPORTATION THIRDPARTY
|
|
import pytest
|
|
|
|
# IMPORTATION INTERNAL
|
|
from openbb_terminal.stocks.fundamental_analysis import polygon_model
|
|
|
|
|
|
@pytest.fixture(scope="module")
|
|
def vcr_config():
|
|
return {
|
|
"filter_headers": [("User-Agent", None)],
|
|
"filter_query_parameters": [
|
|
("apiKey", "MOCK_API_KEY"),
|
|
],
|
|
}
|
|
|
|
|
|
@pytest.mark.vcr
|
|
@pytest.mark.parametrize(
|
|
"func, kwargs_dict",
|
|
[
|
|
(
|
|
"get_financials",
|
|
{"ticker": "AAPL", "financial": "balance", "quarterly": True},
|
|
),
|
|
(
|
|
"get_financials",
|
|
{"ticker": "AAPL", "financial": "balance", "quarterly": False},
|
|
),
|
|
(
|
|
"get_financials",
|
|
{"ticker": "AAPL", "financial": "income", "quarterly": True},
|
|
),
|
|
(
|
|
"get_financials",
|
|
{"ticker": "AAPL", "financial": "income", "quarterly": False},
|
|
),
|
|
],
|
|
)
|
|
def test_check_output(func, kwargs_dict, recorder):
|
|
result_df = getattr(polygon_model, func)(**kwargs_dict)
|
|
recorder.capture(result_df)
|
|
|
|
|
|
@pytest.mark.vcr
|
|
def test_check_bad_ticker(recorder):
|
|
result_df = polygon_model.get_financials("THIS_IS_NOT_A_TICKER", "income", False)
|
|
recorder.capture(result_df)
|
|
assert result_df.empty is True
|