Files
OpenBB/tests/bots/stocks/options/test_overview.py
teh_coderer 07c053fcff Bots plots refactor.. 90% html size decrease! (#1686)
* update

* init

* req

* fix

* req

* meh

* updates

* syspath

* update

* local plotly, and scope logic

* refactor

* oops typo

* plot dpi fixes

* fix tests

* fix

* poetry update, reqs

* some adjustments

* added plot settings for scat/options

Co-authored-by: Colin Delahunty <72827203+colin99d@users.noreply.github.com>
Co-authored-by: didierlopes.eth <dro.lopes@campus.fct.unl.pt>
2022-04-15 10:41:17 +01:00

54 lines
1.3 KiB
Python

import pytest
try:
from bots.stocks.options.overview import (
options_data,
run,
overview_command,
)
except ImportError:
pytest.skip(allow_module_level=True)
@pytest.fixture(scope="module")
def vcr_config():
return {
"filter_headers": [("User-Agent", None)],
"filter_query_parameters": [
("period1", "MOCK_PERIOD_1"),
("period2", "MOCK_PERIOD_2"),
("date", "MOCK_DATE"),
],
}
@pytest.mark.vcr
@pytest.mark.bots
def test_options_data(recorder):
value = options_data("TSLA", expiry="2022-04-14")
new_value = [str(type(x)) for x in value]
recorder.capture(new_value)
@pytest.mark.vcr
@pytest.mark.bots
def test_run(recorder):
value = run("TSLA", expiry="2022-04-14")
new_value = [str(type(x)) for x in value]
recorder.capture(new_value)
@pytest.mark.vcr
@pytest.mark.bots
def test_overview_command(recorder):
value = overview_command("TSLA", expiry="2022-04-14")
value["view"] = str(type(value["view"]))
value["embed"] = str(type(value["embed"]))
value["choices"] = str(type(value["choices"]))
value["embeds_img"] = str(type(value["embeds_img"]))
value["images_list"] = str(type(value["images_list"]))
recorder.capture(value)