Skip to content

Commit cf800f9

Browse files
Copilotabrookins
andcommitted
Fix test mocks to use correct SDK key deleted_entries_count
- Updated test mocks to use "deleted_entries_count" instead of "deleted_count" - This matches the actual DeleteQueryResponse from LangCache SDK - All tests now consistently use the correct key name Co-authored-by: abrookins <[email protected]>
1 parent cd08209 commit cf800f9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tests/unit/test_langcache_semantic_cache.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ def test_delete_by_attributes_with_valid_attributes(self, mock_langcache_client)
440440
_, mock_client = mock_langcache_client
441441

442442
mock_response = MagicMock()
443-
mock_response.model_dump.return_value = {"deleted_count": 5}
443+
mock_response.model_dump.return_value = {"deleted_entries_count": 5}
444444
mock_client.delete_query.return_value = mock_response
445445

446446
cache = LangCacheSemanticCache(
@@ -452,7 +452,7 @@ def test_delete_by_attributes_with_valid_attributes(self, mock_langcache_client)
452452

453453
result = cache.delete_by_attributes({"topic": "python"})
454454

455-
assert result == {"deleted_count": 5}
455+
assert result == {"deleted_entries_count": 5}
456456
mock_client.delete_query.assert_called_once_with(attributes={"topic": "python"})
457457

458458
def test_delete_by_attributes_with_empty_attributes_returns_empty(
@@ -482,7 +482,7 @@ async def test_adelete_by_attributes_with_valid_attributes(
482482
_, mock_client = mock_langcache_client
483483

484484
mock_response = MagicMock()
485-
mock_response.model_dump.return_value = {"deleted_count": 3}
485+
mock_response.model_dump.return_value = {"deleted_entries_count": 3}
486486
mock_client.delete_query_async = AsyncMock(return_value=mock_response)
487487

488488
cache = LangCacheSemanticCache(
@@ -494,7 +494,7 @@ async def test_adelete_by_attributes_with_valid_attributes(
494494

495495
result = await cache.adelete_by_attributes({"language": "python"})
496496

497-
assert result == {"deleted_count": 3}
497+
assert result == {"deleted_entries_count": 3}
498498
mock_client.delete_query_async.assert_called_once_with(
499499
attributes={"language": "python"}
500500
)

0 commit comments

Comments
 (0)