Files
OpenBB/tests/openbb_terminal/cryptocurrency/defi/test_graph_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

39 lines
974 B
Python

# IMPORTATION STANDARD
# IMPORTATION THIRDPARTY
import pytest
# IMPORTATION INTERNAL
from openbb_terminal.cryptocurrency.defi import graph_view
@pytest.mark.vcr
@pytest.mark.parametrize(
"func, kwargs",
[
("display_uni_tokens", dict(skip=0, limit=5)),
("display_uni_stats", dict()),
("display_uni_pools", dict()),
("display_last_uni_swaps", dict(limit=5)),
],
)
def test_call_func(func, kwargs, mocker):
# MOCK EXPORT_DATA
mocker.patch(target="openbb_terminal.cryptocurrency.defi.graph_view.export_data")
getattr(graph_view, func)(**kwargs)
@pytest.mark.vcr(filter_post_data_parameters=[("query", "MOCK_QUERY")])
def test_display_recently_added(mocker):
# MOCK EXPORT_DATA
mocker.patch(target="openbb_terminal.cryptocurrency.defi.graph_view.export_data")
graph_view.display_recently_added(
limit=10,
days=7,
min_volume=20,
min_liquidity=0,
min_tx=100,
)