mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-11-01 23:12:21 +00:00
* bump * Initial function write * Delete this line from yaml * Changed all the main things - Need help on tests * pylint errors * Tests v0 * Tests v1 * Tests v2 --------- Co-authored-by: andrewkenreich <andrew.kenreich@gmail.com>
42 lines
892 B
Python
42 lines
892 B
Python
# IMPORTATION STANDARD
|
|
|
|
# IMPORTATION THIRDPARTY
|
|
import pandas as pd
|
|
import pytest
|
|
|
|
# IMPORTATION INTERNAL
|
|
from openbb_terminal.cryptocurrency.defi import coindix_model
|
|
|
|
|
|
@pytest.mark.vcr
|
|
def test_get_defi_vaults(recorder):
|
|
df = coindix_model.get_defi_vaults(
|
|
chain=None,
|
|
protocol=None,
|
|
kind=None,
|
|
)
|
|
recorder.capture(df)
|
|
|
|
|
|
@pytest.mark.vcr(record_mode="none")
|
|
def test_get_defi_vaults_no_data(mocker):
|
|
# MOCK GET
|
|
attrs = {
|
|
"status_code": 200,
|
|
"json.return_value": {"data": []},
|
|
}
|
|
mock_response = mocker.Mock(**attrs)
|
|
mocker.patch(
|
|
target="openbb_terminal.helper_funcs.requests.get",
|
|
new=mocker.Mock(return_value=mock_response),
|
|
)
|
|
|
|
df = coindix_model.get_defi_vaults(
|
|
chain=None,
|
|
protocol=None,
|
|
kind=None,
|
|
)
|
|
|
|
assert isinstance(df, pd.DataFrame)
|
|
assert df.empty
|