mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-27 12:40:35 +00:00
* Fix forex polygon model tests * Release pandas version lock * Release pylint version lock on the CI * Alternative : covid - fix csv separator issue * FIx spacing change related to pandas upgrade Co-authored-by: Chavithra PARANA <chavithra@gmail.com>
41 lines
947 B
Python
41 lines
947 B
Python
import pytest
|
|
|
|
# IMPORTATION INTERNAL
|
|
from openbb_terminal.forex import polygon_model
|
|
|
|
|
|
@pytest.fixture(scope="module")
|
|
def vcr_config():
|
|
return {
|
|
"filter_query_parameters": [
|
|
("apiKey", "MOCK_API_KEY"),
|
|
]
|
|
}
|
|
|
|
|
|
@pytest.mark.vcr
|
|
@pytest.mark.parametrize(
|
|
"fx_pair,from_date,to_date",
|
|
[
|
|
("EURUSD", "2022-02-20", "2022-03-15"),
|
|
("USDEUR", "2022-02-20", "2022-03-15"),
|
|
],
|
|
)
|
|
def test_get_historical(fx_pair, from_date, to_date, recorder):
|
|
result = polygon_model.get_historical(
|
|
fx_pair=fx_pair, from_date=from_date, to_date=to_date
|
|
)
|
|
recorder.capture(result)
|
|
|
|
|
|
@pytest.mark.vcr
|
|
@pytest.mark.parametrize(
|
|
"fx_pair,from_date,to_date",
|
|
[
|
|
("BADTICKER", "2022-02-20", "2022-03-15"),
|
|
],
|
|
)
|
|
@pytest.mark.record_stdout
|
|
def test_bad_symbols(fx_pair, from_date, to_date):
|
|
polygon_model.get_historical(fx_pair=fx_pair, from_date=from_date, to_date=to_date)
|