mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-27 12:40:35 +00:00
* fix circular import issues on the obbject extension framework * settings available on the obbject * extension init * charting assets and code * introduce to_chart functionality * removes the to_chart method from obbject in detriment of the one from the obbject extension * Update openbb_platform/obbject_extensions/charting/charting/__init__.py Co-authored-by: montezdesousa <79287829+montezdesousa@users.noreply.github.com> * fix on the show method * adding the example to the to_chart docstring * copying the exsting README from charting extension - needs to be revamped * moving to openbb_charting instead * update the pyproject.toml file * pydocstyle * versions * better docstrings * making accessors public * removing unnecessary credentials variable cc @montezdesousa * removing access to extra/metadata and use designated private attrs instead * Fixes linting for the logging service (#5992) * lints * typing.Type instead * deprecating ChartingService to use the new extension instead - adding function discovery capabilities using it * tests for the obbject charting extension * removing charting service from command runner * filter functions not implemented in the module * remove charting service tests * removing charting service on the tests for int tests * charting integration tests * removing charting service file * removing old charting extension code * revamp builder * fix obbject tests * fix command_runner tests * removing openbb_figure_table * better website docs * reviewed readme * unsetting api key for posthog (pywry) windows * added debug_mode to the system settings * removing api key * update nightly script * fix tests * black * black * Revert "black" This reverts commit21d76ad689. * Revert "black" This reverts commit0904653fd7. * black for henrique * returning a list instead * better docstrings * removing unnecessary indicators docstring * typo * black * intentional access to protected member * changes to publish script * filtering deleted files * black * adding render argument * fixing the df_to_basemodel function: it should include the index in the columns either if flagged or if the index is named * adding the hability to add you own data to to_chart method * tests * black * disable protected access * accept kwargs to eg. save image * adjustment cc Igor * add if statement for protection * remove unused return typing * fix technical charting views * better error message cc @IgorWounds * better structure and fix test * Revert "better structure and fix test" This reverts commit612ea6117c. * Revert "better error message cc @IgorWounds" This reverts commit3d7ee53878. --------- Co-authored-by: montezdesousa <79287829+montezdesousa@users.noreply.github.com> Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> Co-authored-by: Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com> Co-authored-by: James Maslek <jmaslek11@gmail.com>
72 lines
2.4 KiB
Python
72 lines
2.4 KiB
Python
"""Test the integration tests."""
|
|
|
|
from typing import Literal
|
|
|
|
from openbb_charting import Charting
|
|
|
|
from extensions.tests.utils.integration_tests_testers import (
|
|
check_missing_integration_test_params,
|
|
check_missing_integration_test_providers,
|
|
check_missing_integration_tests,
|
|
check_outdated_integration_tests,
|
|
check_wrong_integration_test_params,
|
|
get_integration_tests,
|
|
get_module_functions,
|
|
)
|
|
|
|
|
|
def run_test(test_type: Literal["api", "python"], check_function) -> None:
|
|
"""Run tests helper function."""
|
|
integration_tests = get_integration_tests(test_type=test_type)
|
|
functions = get_module_functions(integration_tests)
|
|
missing_items = check_function(functions)
|
|
|
|
assert not missing_items, "\n".join(missing_items)
|
|
|
|
|
|
def test_python_interface_integration_test_providers() -> None:
|
|
"""Test if there are any missing providers for integration tests."""
|
|
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("python", check_missing_integration_test_params)
|
|
|
|
|
|
def test_python_interface_wrong_integration_test_params() -> None:
|
|
"""Test if there are any wrong params for integration tests."""
|
|
run_test("python", check_wrong_integration_test_params)
|
|
|
|
|
|
def test_charting_extension_function_coverage() -> None:
|
|
"""Test if all charting extension functions are covered by integration tests."""
|
|
functions = 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)
|
|
|
|
|
|
def test_missing_api_integration_tests() -> None:
|
|
"""Check if there are missing tests."""
|
|
missing = check_missing_integration_tests(test_type="python")
|
|
assert not missing, "\n".join(missing)
|
|
|
|
|
|
def test_outdated_api_integration_tests() -> None:
|
|
"""Check if there are outdated tests."""
|
|
outdated = check_outdated_integration_tests(test_type="python")
|
|
assert not outdated, "\n".join(outdated)
|