Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vblagoje committed Dec 20, 2024
1 parent 877a3e6 commit ae1efed
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions test/components/tools/test_tool_openapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import os
import pytest

from haystack_experimental.tools.openapi import OpenAPIKwargs, create_tools_from_openapi_spec
from haystack_experimental.tools.openapi import OpenAPIKwargs, _create_tools_from_openapi_spec
from haystack_experimental.dataclasses.tool import Tool


Expand All @@ -34,7 +34,7 @@ def test_from_openapi_spec_serperdev(self):
assert serper_api_key is not None

# Direct kwargs usage
tools = create_tools_from_openapi_spec(
tools = _create_tools_from_openapi_spec(
spec="https://bit.ly/serperdev_openapi",
credentials=serper_api_key
)
Expand All @@ -47,7 +47,7 @@ def test_from_openapi_spec_serperdev(self):
config = OpenAPIKwargs(
credentials=serper_api_key
)
tools = create_tools_from_openapi_spec(spec="https://bit.ly/serperdev_openapi", **config)
tools = _create_tools_from_openapi_spec(spec="https://bit.ly/serperdev_openapi", **config)
assert len(tools) >= 1
tool = tools[0]
assert tool.name == "search"
Expand All @@ -57,7 +57,7 @@ def test_from_openapi_spec_serperdev(self):
config = OpenAPIKwargs(**{
"credentials": serper_api_key
})
tools = create_tools_from_openapi_spec(spec="https://bit.ly/serperdev_openapi", **config)
tools = _create_tools_from_openapi_spec(spec="https://bit.ly/serperdev_openapi", **config)
assert len(tools) >= 1
tool = tools[0]
assert tool.name == "search"
Expand All @@ -83,7 +83,7 @@ def test_from_openapi_spec_serperdev_with_allowed_operations(self):
assert serper_api_key is not None

# Direct kwargs usage
tools = create_tools_from_openapi_spec(
tools = _create_tools_from_openapi_spec(
spec="https://bit.ly/serperdev_openapi",
credentials=serper_api_key,
allowed_operations=["search"]
Expand All @@ -98,7 +98,7 @@ def test_from_openapi_spec_serperdev_with_allowed_operations(self):
credentials=serper_api_key,
allowed_operations=["search"]
)
tools = create_tools_from_openapi_spec(spec="https://bit.ly/serperdev_openapi", **config)
tools = _create_tools_from_openapi_spec(spec="https://bit.ly/serperdev_openapi", **config)
assert len(tools) >= 1
tool = tools[0]
assert tool.name == "search"
Expand All @@ -109,7 +109,7 @@ def test_from_openapi_spec_serperdev_with_allowed_operations(self):
"credentials": serper_api_key,
"allowed_operations": ["search"]
})
tools = create_tools_from_openapi_spec(spec="https://bit.ly/serperdev_openapi", **config)
tools = _create_tools_from_openapi_spec(spec="https://bit.ly/serperdev_openapi", **config)
assert len(tools) >= 1
tool = tools[0]
assert tool.name == "search"
Expand All @@ -120,7 +120,7 @@ def test_from_openapi_spec_serperdev_with_allowed_operations(self):
credentials=serper_api_key,
allowed_operations=["super-search"]
)
tools = create_tools_from_openapi_spec(spec="https://bit.ly/serperdev_openapi", **config)
tools = _create_tools_from_openapi_spec(spec="https://bit.ly/serperdev_openapi", **config)
assert len(tools) == 0

@pytest.mark.skipif(
Expand Down

0 comments on commit ae1efed

Please sign in to comment.