mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-11-10 11:21:12 +00:00
Feature/integration tests python data processing cmds (#5511)
* chaging the generator to handle data processing commands * ruff n black
This commit is contained in:
170
openbb_platform/extensions/qa/integration/test_qa_python.py
Normal file
170
openbb_platform/extensions/qa/integration/test_qa_python.py
Normal file
@@ -0,0 +1,170 @@
|
||||
"""Test qa extension."""
|
||||
import pytest
|
||||
from openbb_core.app.model.obbject import OBBject
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def obb(pytestconfig):
|
||||
"""Fixture to setup obb."""
|
||||
|
||||
if pytestconfig.getoption("markexpr") != "not integration":
|
||||
import openbb
|
||||
|
||||
return openbb.obb
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"params",
|
||||
[
|
||||
({"data": "", "target": "", "return": ""}),
|
||||
],
|
||||
)
|
||||
@pytest.mark.integration
|
||||
def test_qa_normality(params, obb):
|
||||
result = obb.qa.normality(**params)
|
||||
assert result
|
||||
assert isinstance(result, OBBject)
|
||||
assert len(result.results) > 0
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"params",
|
||||
[
|
||||
({"data": "", "target": "", "return": ""}),
|
||||
],
|
||||
)
|
||||
@pytest.mark.integration
|
||||
def test_qa_capm(params, obb):
|
||||
result = obb.qa.capm(**params)
|
||||
assert result
|
||||
assert isinstance(result, OBBject)
|
||||
assert len(result.results) > 0
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"params",
|
||||
[
|
||||
(
|
||||
{
|
||||
"data": "",
|
||||
"target": "",
|
||||
"threshold_start": "",
|
||||
"threshold_end": "",
|
||||
"return": "",
|
||||
}
|
||||
),
|
||||
],
|
||||
)
|
||||
@pytest.mark.integration
|
||||
def test_qa_om(params, obb):
|
||||
result = obb.qa.om(**params)
|
||||
assert result
|
||||
assert isinstance(result, OBBject)
|
||||
assert len(result.results) > 0
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"params",
|
||||
[
|
||||
({"data": "", "target": "", "window": "", "return": ""}),
|
||||
],
|
||||
)
|
||||
@pytest.mark.integration
|
||||
def test_qa_kurtosis(params, obb):
|
||||
result = obb.qa.kurtosis(**params)
|
||||
assert result
|
||||
assert isinstance(result, OBBject)
|
||||
assert len(result.results) > 0
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"params",
|
||||
[
|
||||
({"data": "", "target": "", "fuller_reg": "", "kpss_reg": "", "return": ""}),
|
||||
],
|
||||
)
|
||||
@pytest.mark.integration
|
||||
def test_qa_unitroot(params, obb):
|
||||
result = obb.qa.unitroot(**params)
|
||||
assert result
|
||||
assert isinstance(result, OBBject)
|
||||
assert len(result.results) > 0
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"params",
|
||||
[
|
||||
({"data": "", "target": "", "rfr": "", "window": "", "return": ""}),
|
||||
],
|
||||
)
|
||||
@pytest.mark.integration
|
||||
def test_qa_sh(params, obb):
|
||||
result = obb.qa.sh(**params)
|
||||
assert result
|
||||
assert isinstance(result, OBBject)
|
||||
assert len(result.results) > 0
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"params",
|
||||
[
|
||||
(
|
||||
{
|
||||
"data": "",
|
||||
"target": "",
|
||||
"target_return": "",
|
||||
"window": "",
|
||||
"adjusted": "",
|
||||
"return": "",
|
||||
}
|
||||
),
|
||||
],
|
||||
)
|
||||
@pytest.mark.integration
|
||||
def test_qa_so(params, obb):
|
||||
result = obb.qa.so(**params)
|
||||
assert result
|
||||
assert isinstance(result, OBBject)
|
||||
assert len(result.results) > 0
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"params",
|
||||
[
|
||||
({"data": "", "target": "", "window": "", "return": ""}),
|
||||
],
|
||||
)
|
||||
@pytest.mark.integration
|
||||
def test_qa_skew(params, obb):
|
||||
result = obb.qa.skew(**params)
|
||||
assert result
|
||||
assert isinstance(result, OBBject)
|
||||
assert len(result.results) > 0
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"params",
|
||||
[
|
||||
({"data": "", "target": "", "window": "", "quantile_pct": "", "return": ""}),
|
||||
],
|
||||
)
|
||||
@pytest.mark.integration
|
||||
def test_qa_quantile(params, obb):
|
||||
result = obb.qa.quantile(**params)
|
||||
assert result
|
||||
assert isinstance(result, OBBject)
|
||||
assert len(result.results) > 0
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"params",
|
||||
[
|
||||
({"data": "", "target": "", "return": ""}),
|
||||
],
|
||||
)
|
||||
@pytest.mark.integration
|
||||
def test_qa_summary(params, obb):
|
||||
result = obb.qa.summary(**params)
|
||||
assert result
|
||||
assert isinstance(result, OBBject)
|
||||
assert len(result.results) > 0
|
||||
Reference in New Issue
Block a user