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
* returning always a dataframe
* Revert "returning always a dataframe"
This reverts commit d5dbf3132f.
* black everything
---------
48 lines
1.0 KiB
Python
48 lines
1.0 KiB
Python
# IMPORTATION STANDARD
|
|
|
|
# IMPORTATION THIRDPARTY
|
|
import pytest
|
|
|
|
# IMPORTATION INTERNAL
|
|
from openbb_terminal.stocks.discovery import finnhub_model
|
|
|
|
|
|
@pytest.fixture(scope="module")
|
|
def vcr_config():
|
|
return {
|
|
"filter_query_parameters": [
|
|
("from", "MOCK_FROM"),
|
|
("to", "MOCK_TO"),
|
|
("token", "MOCK_TOKEN"),
|
|
]
|
|
}
|
|
|
|
|
|
@pytest.mark.vcr
|
|
def test_get_ipo_calendar(recorder):
|
|
ipo_df = finnhub_model.get_ipo_calendar(
|
|
start_date="2021-12-01",
|
|
end_date="2021-12-02",
|
|
)
|
|
recorder.capture(ipo_df)
|
|
|
|
|
|
@pytest.mark.vcr(record_mode="none")
|
|
def test_get_ipo_calendar_400(mocker):
|
|
attrs = {
|
|
"status_code": 400,
|
|
"json.return_value": {"error": "mock error message"},
|
|
}
|
|
|
|
mock_response = mocker.Mock(**attrs)
|
|
|
|
mocker.patch(
|
|
target="openbb_terminal.helper_funcs.requests.get",
|
|
new=mocker.Mock(return_value=mock_response),
|
|
)
|
|
ipo_df = finnhub_model.get_ipo_calendar(
|
|
start_date="2021-12-01",
|
|
end_date="2021-12-02",
|
|
)
|
|
assert ipo_df.empty
|