Files
OpenBB/tests/openbb_terminal/cryptocurrency/defi/test_coindix_view.py
Colin Delahunty 5bc7bc070e Tests over API Best Practices (#2344)
* Started new tests

* Added special function

* Improved dict

* Finished new test

* Got bad functions to 75

* Got bad func to 73

* Bad func down to 60

* Bad func down to 50

* Bad func down to 35

* Got bad func to 30

* No more bad functions

* Added tests

* Added fix

* Fixed some tests

* Fixed some tests

* Fixed some tests

* Fixed some tests

* Added tests to CI

* Fixed CI tests

* Fixed CI tests

* Imrproved CI tests

* Fixed reports

* Fixed reports

* Added stuff

* Removed CI

* Fixed

* Fixed some typing'

Co-authored-by: minhhoang1023 <40023817+minhhoang1023@users.noreply.github.com>
2022-09-22 22:31:46 +01:00

48 lines
1.1 KiB
Python

# IMPORTATION STANDARD
# IMPORTATION THIRDPARTY
import pandas as pd
import pytest
# IMPORTATION INTERNAL
from openbb_terminal.cryptocurrency.defi import coindix_view
@pytest.mark.vcr
@pytest.mark.record_stdout
def test_display_defi_vaults(mocker):
# MOCK EXPORT_DATA
mocker.patch(target="openbb_terminal.cryptocurrency.defi.coindix_view.export_data")
coindix_view.display_defi_vaults(
chain=None,
protocol=None,
kind=None,
limit=None,
sortby="apy",
ascend=False,
link=True,
export="",
)
@pytest.mark.vcr(record_mode="none")
@pytest.mark.record_stdout
def test_display_defi_vaults_empty_df(mocker):
# MOCK GET_DEFI_VAULTS
mocker.patch(
target="openbb_terminal.cryptocurrency.defi.coindix_view.coindix_model.get_defi_vaults",
return_value=pd.DataFrame(),
)
coindix_view.display_defi_vaults(
chain=None,
protocol=None,
kind=None,
limit=None,
sortby="apy",
ascend=False,
link=True,
export="",
)