mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-11-09 10:51:57 +00:00
* stashing * ecb yield curve * field_description * federal reserve yield curve * econdb yield curve * countries literal for python 3.9 * list date * fmp yield curve * fred yield curve * integration tests * chart integration tests * static assets * black * ruff * pylint * more pylint * more pylint * now black * country not a standard param * mypy * merge branch develop * add more countries * econdb date filter * mypy * future linting * make to_chart work * plot_bgcolor should be 'rbga(255,255,255,0)' * push deprecation * push deprecation --------- Co-authored-by: Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com> Co-authored-by: hjoaquim <henriquecjoaquim@gmail.com>
66 lines
1.9 KiB
Python
66 lines
1.9 KiB
Python
""" Test ECB Fetchers. """
|
|
|
|
import datetime
|
|
|
|
import pytest
|
|
from openbb_core.app.service.user_service import UserService
|
|
from openbb_ecb.models.balance_of_payments import ECBBalanceOfPaymentsFetcher
|
|
from openbb_ecb.models.currency_reference_rates import ECBCurrencyReferenceRatesFetcher
|
|
from openbb_ecb.models.eu_yield_curve import ECBEUYieldCurveFetcher
|
|
from openbb_ecb.models.yield_curve import ECBYieldCurveFetcher
|
|
|
|
test_credentials = UserService().default_user_settings.credentials.model_dump(
|
|
mode="json"
|
|
)
|
|
|
|
|
|
@pytest.fixture(scope="module")
|
|
def vcr_config():
|
|
"""VCR config."""
|
|
return {
|
|
"filter_headers": [("User-Agent", None)],
|
|
"filter_query_parameters": [
|
|
("token", "MOCK_TOKEN"),
|
|
],
|
|
}
|
|
|
|
|
|
@pytest.mark.record_http
|
|
def test_ecbeu_yield_curve_fetcher(credentials=test_credentials):
|
|
"""Test ECBEUYieldCurveFetcher."""
|
|
params = {"date": datetime.date(2023, 1, 1)}
|
|
|
|
fetcher = ECBEUYieldCurveFetcher()
|
|
result = fetcher.test(params, credentials)
|
|
assert result is None
|
|
|
|
|
|
@pytest.mark.record_http
|
|
def test_ecb_currency_reference_rates_fetcher(credentials=test_credentials):
|
|
"""Test ECB Currency Reference Rates Fecher."""
|
|
params = {}
|
|
|
|
fetcher = ECBCurrencyReferenceRatesFetcher()
|
|
result = fetcher.test(params, credentials)
|
|
assert result is None
|
|
|
|
|
|
@pytest.mark.record_http
|
|
def test_ecb_balance_of_payments_fetcher(credentials=test_credentials):
|
|
"""Test ECB Balance Of Payments Fetcher."""
|
|
params = {"date": datetime.date(2023, 1, 1)}
|
|
|
|
fetcher = ECBBalanceOfPaymentsFetcher()
|
|
result = fetcher.test(params, credentials)
|
|
assert result is None
|
|
|
|
|
|
@pytest.mark.record_http
|
|
def test_ecb_yield_curve_fetcher(credentials=test_credentials):
|
|
"""Test ECBYieldCurveFetcher."""
|
|
params = {"date": "2004-11-19,2023-11-19", "use_cache": False}
|
|
|
|
fetcher = ECBYieldCurveFetcher()
|
|
result = fetcher.test(params, credentials)
|
|
assert result is None
|