Files
OpenBB/tests/openbb_terminal/stocks/test_databento_model.py
James Maslek 425b740eda Hotfix/databento + bugs (#4973)
* bump pywry

* fix rm command (#4890)

Co-authored-by: Henrique Joaquim <h.joaquim@campus.fct.unl.pt>

* Fix `crypto/defi/anchor` (#4892)

* handle defi anchor exceptions

* reason

* mypy

---------

Co-authored-by: Henrique Joaquim <h.joaquim@campus.fct.unl.pt>

* fix windows pyinstaller subprocess fail if space in path

* remove API_IEX_TOKEN

* remove API_SENTIMENTINVESTOR_TOKEN

* Fix data bento calls

* Fix options eod chain bug

* Fix finviz get

* Fix yf balance bug

* removing breakline

* Add error message

---------

Co-authored-by: teh_coderer <me@tehcoderer.com>
Co-authored-by: montezdesousa <79287829+montezdesousa@users.noreply.github.com>
Co-authored-by: Henrique Joaquim <h.joaquim@campus.fct.unl.pt>
2023-05-09 08:16:32 +00:00

36 lines
901 B
Python

import pytest
from openbb_terminal.stocks import databento_model
@pytest.fixture(scope="module")
def vcr_config():
return {
"filter_headers": [
("User-Agent", None),
("Authorization", "MOCK_AUTHORIZATION"),
],
}
def test_databento_model():
"""Tests the DataBento model."""
model = databento_model.DataBento(
symbol="AAPL", start="2021-08-10", end="2021-08-11"
)
assert model.symbol == "AAPL"
assert model.exchange == "XNAS.ITCH"
assert model.stype == "native"
assert model.start == "2021-08-10"
assert model.end == "2021-08-11"
@pytest.mark.vcr
def test_stock_load(recorder):
"""Tests the stock load function."""
result = databento_model.get_historical_stock(
symbol="AAPL", start_date="2022-08-01", end_date="2022-10-01"
)
assert result.empty is False
recorder.capture(result)