mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-29 13:32:08 +00:00
* 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>
34 lines
856 B
Python
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)
|