Files
OpenBB/tests/openbb_terminal/fixedincome/test_oecd_model.py
Igor Radovanovic 65e3c8573c Fixed income unit tests (#4568)
* fixed income unit tests

* api key fix

* fix mock api key

* Update poetry.lock

* Poetry

* Pytest : fix name collisions

* dependency update

* Re-record unit test

* Update unit tests

---------

Co-authored-by: Luqman <luqazino@gmail.com>
Co-authored-by: Chavithra <chavithra@gmail.com>
2023-04-03 16:42:23 +00:00

21 lines
621 B
Python

from datetime import datetime
import pytest
from pandas import DataFrame
from openbb_terminal.fixedincome import oecd_model
@pytest.mark.vcr
@pytest.mark.parametrize("data", ["short", "short_forecast", "long", "long_forecast"])
def test_get_interest_rates(recorder, data):
"""Test get_interest_rates"""
data = oecd_model.get_interest_rate_data(
data=data,
countries=["united_states", "canada"],
start_date=datetime.strptime("2022-01-01", "%Y-%m-%d"),
end_date=datetime.strptime("2022-01-31", "%Y-%m-%d"),
)
assert isinstance(data, DataFrame)
recorder.capture(data)