mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-11-12 04:13:06 +00:00
* Removed tabulate * Removed way more tab * Fixed tests * Reverted test * Fixed pylint * Fixed tests * Fixed Mypy Issue Co-authored-by: didierlopes.eth <dro.lopes@campus.fct.unl.pt>
58 lines
1.4 KiB
Python
58 lines
1.4 KiB
Python
# IMPORTATION STANDARD
|
|
|
|
# IMPORTATION THIRDPARTY
|
|
import pytest
|
|
|
|
# IMPORTATION INTERNAL
|
|
from gamestonk_terminal.etf import financedatabase_view
|
|
from gamestonk_terminal import helper_funcs
|
|
|
|
|
|
@pytest.fixture(scope="module")
|
|
def vcr_config():
|
|
return {
|
|
"filter_headers": [("User-Agent", None)],
|
|
}
|
|
|
|
|
|
@pytest.mark.vcr()
|
|
@pytest.mark.record_stdout
|
|
@pytest.mark.parametrize(
|
|
"name",
|
|
["oil", "banks"],
|
|
)
|
|
def test_display_etf_by_name(name, mocker):
|
|
mocker.patch.object(
|
|
target=helper_funcs.gtff, attribute="USE_TABULATE_DF", new=False
|
|
)
|
|
financedatabase_view.display_etf_by_name(name, limit=5, export="")
|
|
|
|
|
|
@pytest.mark.vcr()
|
|
@pytest.mark.record_stdout
|
|
@pytest.mark.parametrize(
|
|
"description",
|
|
["oil", "banks"],
|
|
)
|
|
def test_display_etf_by_description(description, mocker):
|
|
mocker.patch.object(
|
|
target=helper_funcs.gtff, attribute="USE_TABULATE_DF", new=False
|
|
)
|
|
financedatabase_view.display_etf_by_description(description, limit=5, export="")
|
|
|
|
|
|
@pytest.mark.vcr()
|
|
@pytest.mark.record_stdout
|
|
@pytest.mark.parametrize(
|
|
"category",
|
|
[
|
|
"Bank Loan",
|
|
"Bear Market",
|
|
],
|
|
)
|
|
def test_display_etf_by_category(category, mocker):
|
|
mocker.patch.object(
|
|
target=helper_funcs.gtff, attribute="USE_TABULATE_DF", new=False
|
|
)
|
|
financedatabase_view.display_etf_by_category(category, limit=5, export="")
|