From b6f216ed25277dd197cd38791f219a64c791eb7f Mon Sep 17 00:00:00 2001 From: Evan Mattson Date: Thu, 19 Dec 2024 13:06:14 +0900 Subject: [PATCH] model rebuild for openapi tests --- .../unit/connectors/openapi_plugin/test_sk_openapi.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/python/tests/unit/connectors/openapi_plugin/test_sk_openapi.py b/python/tests/unit/connectors/openapi_plugin/test_sk_openapi.py index 0df4bc63b0f6..094d57619c53 100644 --- a/python/tests/unit/connectors/openapi_plugin/test_sk_openapi.py +++ b/python/tests/unit/connectors/openapi_plugin/test_sk_openapi.py @@ -733,6 +733,10 @@ async def dummy_auth_callback(**kwargs): @pytest.fixture def openapi_runner_with_predicate_callback(): + from semantic_kernel.connectors.openapi_plugin import OperationSelectionPredicateContext # noqa: F401 + + OpenAPIFunctionExecutionParameters.model_rebuild() + # Define a dummy predicate callback def predicate_callback(context): # Skip operations with DELETE method or containing 'internal' in the path @@ -809,6 +813,10 @@ async def test_run_operation_with_error(mock_request, openapi_runner): def test_invalid_server_url_override(): + from semantic_kernel.connectors.openapi_plugin import OperationSelectionPredicateContext # noqa: F401 + + OpenAPIFunctionExecutionParameters.model_rebuild() + with pytest.raises(ValueError, match="Invalid server_url_override: invalid_url"): params = OpenAPIFunctionExecutionParameters(server_url_override="invalid_url") params.model_post_init(None)