mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-28 13:01:38 +00:00
Charting extension integration tests (#5547)
* initial proposal for integration tests on the charting extension * int tests for charting generation * python generator * ruff * boilerplate templates * python tests * tests for the api * using body instead so data don't get redefined * unit tests for coverage * ruff * docstrings * unnecessary access to keys()
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
"""Test the integration tests."""
|
||||
from openbb_core.app.charting_service import ChartingService
|
||||
|
||||
from extensions.tests.utils.integration_tests_testers import (
|
||||
check_missing_integration_test_params,
|
||||
check_missing_integration_test_providers,
|
||||
@@ -24,3 +26,23 @@ def test_python_interface_integration_test_providers() -> None:
|
||||
def test_python_interface_integration_test_params() -> None:
|
||||
"""Test if there are any missing params for integration tests."""
|
||||
run_test("python", check_missing_integration_test_params)
|
||||
|
||||
|
||||
def test_charting_extension_function_coverage() -> None:
|
||||
"""Test if all charting extension functions are covered by integration tests."""
|
||||
|
||||
functions = ChartingService.get_implemented_charting_functions()
|
||||
test_names = [f"test_chart_{func}" for func in functions]
|
||||
integration_tests_modules = get_integration_tests(
|
||||
test_type="python", filter_charting_ext=False
|
||||
)
|
||||
charting_module = [
|
||||
module for module in integration_tests_modules if "charting" in module.__name__
|
||||
]
|
||||
integration_tests_functions = get_module_functions(charting_module)
|
||||
|
||||
missing_items = [
|
||||
test for test in test_names if test not in integration_tests_functions
|
||||
]
|
||||
|
||||
assert missing_items == [], "\n".join(missing_items)
|
||||
|
||||
Reference in New Issue
Block a user