mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-11-05 08:51:20 +00:00
* 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
36 lines
894 B
Python
36 lines
894 B
Python
# IMPORTATION STANDARD
|
|
from datetime import datetime
|
|
|
|
# IMPORTATION THIRDPARTY
|
|
import pytest
|
|
import requests
|
|
|
|
# IMPORTATION INTERNAL
|
|
from gamestonk_terminal.stocks.options import alphaquery_model
|
|
|
|
|
|
@pytest.mark.vcr
|
|
def test_get_put_call_ratio(recorder):
|
|
result_df = alphaquery_model.get_put_call_ratio(
|
|
ticker="PM",
|
|
window=10,
|
|
start_date=datetime.strptime("2021-12-01", "%Y-%m-%d"),
|
|
)
|
|
|
|
recorder.capture(result_df)
|
|
|
|
|
|
@pytest.mark.vcr(record_mode="none")
|
|
def test_get_put_call_ratio_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_df = alphaquery_model.get_put_call_ratio(
|
|
ticker="PM",
|
|
window=10,
|
|
start_date=datetime.strptime("2021-12-01", "%Y-%m-%d"),
|
|
)
|
|
|
|
assert result_df.empty
|