Files
OpenBB/tests/openbb_terminal/cryptocurrency/tools/test_tools_model.py
jose-donato a12e0946da Starts crypto tools menu (#1668)
* started crypto tools menu

* allow zero float

* added obb script

Co-authored-by: Chavithra <chavithra@gmail.com>
Co-authored-by: didierlopes.eth <dro.lopes@campus.fct.unl.pt>
Co-authored-by: minhhoang1023 <40023817+minhhoang1023@users.noreply.github.com>
2022-04-14 14:24:42 +07:00

34 lines
856 B
Python

# IMPORTATION STANDARD
# IMPORTATION THIRDPARTY
import pytest
# IMPORTATION INTERNAL
from openbb_terminal.cryptocurrency.tools import tools_model
@pytest.mark.vcr
@pytest.mark.parametrize(
"apr,compound_times",
[(100, 12)],
)
def test_calculate_apy(apr, compound_times, recorder):
df, _ = tools_model.calculate_apy(apr=apr, compounding_times=compound_times)
recorder.capture(df)
@pytest.mark.vcr
@pytest.mark.parametrize(
"price_changeA,price_changeB,proportion,initial_pool_value", [(100, 200, 50, 1000)]
)
def test_calculate_il(
price_changeA, price_changeB, proportion, initial_pool_value, recorder
):
df, _ = tools_model.calculate_il(
price_changeA=price_changeA,
price_changeB=price_changeB,
proportion=proportion,
initial_pool_value=initial_pool_value,
)
recorder.capture(df)