Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion tests/features/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def after_scenario(context: Context, scenario: Scenario) -> None:
and context.client.last_response
):
print(f" Status: {context.client.last_response.status_code}")
print(f" Data: {context.client.last_response_data}")
if hasattr(context.client, "last_response_data"):
print(f" Data: {context.client.last_response_data}")
else:
print(f"✅ {scenario.name}")
Original file line number Diff line number Diff line change
Expand Up @@ -241,9 +241,14 @@ async def test_filter_tools_for_response_skips_filtering_below_threshold(
lightspeed_agents_impl.config.tools_filter.min_tools = 10 # High threshold

# Setup mock tool runtime to return few tools (below threshold)
# Setup mock tool runtime to return few tools (below threshold)
tool1_mock = MagicMock(description="Tool 1")
tool1_mock.name = "tool1"
tool2_mock = MagicMock(description="Tool 2")
tool2_mock.name = "tool2"
lightspeed_agents_impl.tool_runtime_api.list_runtime_tools.side_effect = [
MagicMock(data=[MagicMock(name="tool1", description="Tool 1")]),
MagicMock(data=[MagicMock(name="tool2", description="Tool 2")]),
MagicMock(data=[tool1_mock]),
MagicMock(data=[tool2_mock]),
]

tools = [
Expand Down
33 changes: 32 additions & 1 deletion tests/unit/providers/remote/solr_vector_io/test_doc_to_chunk.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@

@pytest.fixture
def chunk_window_config():
"""
Create a ChunkWindowConfig with explicit field names used by the tests.

Returns:
ChunkWindowConfig: Configuration mapping chunk fields (content, index, token count)
and parent document fields (id, title, url, totals) to the names expected
by the SolrIndex test fixtures.
"""
return ChunkWindowConfig(
chunk_parent_id_field="parent_id",
chunk_index_field="chunk_index",
Expand All @@ -37,7 +45,18 @@ def chunk_window_config():

@pytest.fixture
def solr_index(chunk_window_config):
"""SolrIndex created without connecting to Solr (initialize() not called)."""
"""
Create a SolrIndex configured for tests without calling initialize().

Parameters:
chunk_window_config (ChunkWindowConfig): Configuration that maps parent
document and chunk field names used by the index.

Returns:
SolrIndex: A SolrIndex instance pointing to a local test Solr
collection and using the provided chunk window configuration; the
instance is not initialized.
"""
vector_store = VectorDB(
identifier="test-store",
embedding_dimension=EMBEDDING_DIM,
Expand All @@ -58,6 +77,18 @@ def solr_index(chunk_window_config):


def _basic_doc(**extra):
"""
Return a baseline document dictionary representing a chunk, with sensible defaults.

Parameters:
**extra: Additional key-value pairs to merge into the returned
document; provided keys override defaults.

Returns:
dict: Document containing "id" (default "doc_chunk_0"), "chunk"
(default "Test content."), and "parent_id" (default "doc"), merged with
any entries from `extra`.
"""
return {"id": "doc_chunk_0", "chunk": "Test content.", "parent_id": "doc", **extra}


Expand Down
Loading