mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-11-06 09:22:26 +00:00
Cleanup
This commit is contained in:
@@ -20,10 +20,10 @@ def run_test(test_type: str, check_function) -> None:
|
||||
@pytest.mark.skip(reason="Needs uvicorn to be launched but shouldn't be the case.")
|
||||
def test_api_interface_integration_test_providers() -> None:
|
||||
"""Test if there are any missing providers for integration tests."""
|
||||
run_test("integration", check_missing_integration_test_providers)
|
||||
run_test("api", check_missing_integration_test_providers)
|
||||
|
||||
|
||||
@pytest.mark.skip(reason="Needs uvicorn to be launched but shouldn't be the case.")
|
||||
def test_api_interface_integration_test_params() -> None:
|
||||
"""Test if there are any missing params for integration tests."""
|
||||
run_test("integration", check_missing_integration_test_params)
|
||||
run_test("api", check_missing_integration_test_params)
|
||||
|
||||
@@ -18,9 +18,9 @@ def run_test(test_type: str, check_function) -> None:
|
||||
|
||||
def test_python_interface_integration_test_providers() -> None:
|
||||
"""Test if there are any missing providers for integration tests."""
|
||||
run_test("unit", check_missing_integration_test_providers)
|
||||
run_test("python", check_missing_integration_test_providers)
|
||||
|
||||
|
||||
def test_python_interface_integration_test_params() -> None:
|
||||
"""Test if there are any missing params for integration tests."""
|
||||
run_test("unit", check_missing_integration_test_params)
|
||||
run_test("python", check_missing_integration_test_params)
|
||||
|
||||
@@ -12,13 +12,13 @@ from openbb_core.app.provider_interface import ProviderInterface
|
||||
from openbb_core.app.router import CommandMap
|
||||
|
||||
|
||||
def get_integration_tests(test_type: Literal["integration", "unit"]) -> List[Any]:
|
||||
def get_integration_tests(test_type: Literal["api", "python"]) -> List[Any]:
|
||||
"""Get integration tests for the OpenBB Platform."""
|
||||
integration_tests: List[Any] = []
|
||||
|
||||
if test_type == "unit":
|
||||
if test_type == "python":
|
||||
file_end = "_python.py"
|
||||
elif test_type == "integration":
|
||||
elif test_type == "api":
|
||||
file_end = "_api.py"
|
||||
|
||||
for extension in find_extensions():
|
||||
@@ -112,9 +112,11 @@ def check_missing_params(
|
||||
if isinstance(command_params, list):
|
||||
for expected_param in command_params[0]:
|
||||
if expected_param not in test_params.keys():
|
||||
missing_params.append(
|
||||
f"Missing param {expected_param} in function {function}"
|
||||
)
|
||||
# if return is the expected param, we can ignore
|
||||
if expected_param != "return":
|
||||
missing_params.append(
|
||||
f"Missing param {expected_param} in function {function}"
|
||||
)
|
||||
return missing_params
|
||||
|
||||
|
||||
@@ -170,6 +172,7 @@ def check_integration_tests(
|
||||
missing_items = check_function(
|
||||
processing_command_params, function_params, function, True
|
||||
)
|
||||
|
||||
all_missing_items.extend(missing_items)
|
||||
|
||||
return all_missing_items
|
||||
|
||||
Reference in New Issue
Block a user