Files
OpenBB/tests/gamestonk_terminal/stocks/options/test_fdscanner_model.py
Chavithra 000d1e93d7 Tests : Stocks > Options (#1125)
* Update tests : conftest

* Updating tests : stocks/options

* Updating tests : fix typing

* Updating tests : black

* Updating tests : pyupgrade

* Updating tests : black

* Updating tests : mock dates in cassettes

* Updating tests : conftest

* Updating tests : black

* Updating tests : force single threading

* Updating tests : skip

* Updating tests : black

* Updating tests : conftest

* Update tests : skip stocks/options/controller

* Updating tests : skip

* Updating tests : skip

* Updating tests : skip

* Updating tests : skip

* Updating tests : skip

* Updating tests : skip

* Updating tests : skip

* Updating tests : skip

* Updating tests : skip

* Updating tests : skip

* Updating tests : skip

* Updating tests : skip

* Updating tests : skip

* Updating tests : skip

* Updating tests : skip

* Updating tests : skip

* Updating tests : skip

* Updating tests : fixing issue

* Updating tests : add init

* Updating tests : skip

* Updating tests : skip

* Updating tests : skip

* Updating tests : skip

* Updating tests : skip

* Updating tests : conftest

* Updating tests : skip

* Updating tests : skip

* Updating tests : skip

* Updating tests : skip
2022-01-04 01:25:31 +01:00

39 lines
915 B
Python

# IMPORTATION STANDARD
# IMPORTATION THIRDPARTY
import pytest
import requests
# IMPORTATION INTERNAL
from gamestonk_terminal.stocks.options import fdscanner_model
@pytest.fixture(scope="module")
def vcr_config():
return {
"filter_headers": [("User-Agent", None)],
}
@pytest.mark.vcr
def test_unusual_options(recorder):
result_tuple = fdscanner_model.unusual_options(num=5)
result_tuple = (
result_tuple[0],
result_tuple[1].isoformat(),
)
recorder.capture_list(result_tuple)
@pytest.mark.vcr(record_mode="none")
def test_unusual_options_invalid_status(mocker):
mock_response = requests.Response()
mock_response.status_code = 400
mocker.patch(target="requests.get", new=mocker.Mock(return_value=mock_response))
result_tuple = fdscanner_model.unusual_options(num=5)
assert result_tuple[0].empty
assert isinstance(result_tuple[1], str)