Files
OpenBB/tests/openbb_terminal/forex/test_polygon_model.py
Theodore Aptekarev 35ba7fd79f Fix tests and bump pandas version (#1888)
* 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>
2022-05-31 14:46:45 +02:00

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)