Test API integration tests

This commit is contained in:
Igor Radovanovic
2023-10-02 17:34:58 +02:00
parent 2a4e93e8c5
commit 9a9cc14ec1
2 changed files with 31 additions and 15 deletions

View File

@@ -2,24 +2,35 @@
from extensions.tests.utils.integration_tests_testers import (
check_missing_integration_test_params,
check_missing_integration_test_providers,
get_integration_tests,
get_module_functions,
get_python_integration_tests,
)
def run_test(test_type: str, 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_tests() -> None:
"""Test if there are any missing providers for integration tests."""
integration_tests = get_python_integration_tests()
functions = get_module_functions(integration_tests)
missing_providers = check_missing_integration_test_providers(functions)
assert not missing_providers, "\n".join(missing_providers)
run_test("unit", check_missing_integration_test_providers)
def test_python_interface_integration_test_params() -> None:
"""Test if there are any missing params for integration tests."""
integration_tests = get_python_integration_tests()
functions = get_module_functions(integration_tests)
missing_params = check_missing_integration_test_params(functions)
run_test("unit", check_missing_integration_test_params)
assert not missing_params, "\n".join(missing_params)
def test_api_interface_integration_tests() -> None:
"""Test if there are any missing providers for integration tests."""
run_test("integration", check_missing_integration_test_providers)
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)