Skip to content

Commit 7930314

Browse files
committed
Fix opensearch tests
1 parent fce6b58 commit 7930314

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

key-value/key-value-aio/tests/stores/opensearch/test_opensearch.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ async def test_value_stored_as_f_object(self, store: OpenSearchStore, opensearch
197197
doc_id = store._get_document_id(key="test_key") # pyright: ignore[reportPrivateUsage]
198198

199199
response = await opensearch_client.get(index=index_name, id=doc_id)
200-
assert response.body["_source"] == snapshot(
200+
assert response["_source"] == snapshot(
201201
{
202202
"value": {"flat": {"name": "Alice", "age": 30}},
203203
"created_at": IsStr(min_length=20, max_length=40),
@@ -207,7 +207,7 @@ async def test_value_stored_as_f_object(self, store: OpenSearchStore, opensearch
207207
# Test with TTL
208208
await store.put(collection="test", key="test_key", value={"name": "Bob", "age": 25}, ttl=10)
209209
response = await opensearch_client.get(index=index_name, id=doc_id)
210-
assert response.body["_source"] == snapshot(
210+
assert response["_source"] == snapshot(
211211
{
212212
"value": {"flat": {"name": "Bob", "age": 25}},
213213
"created_at": IsStr(min_length=20, max_length=40),

key-value/key-value-sync/tests/code_gen/stores/opensearch/test_opensearch.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,14 +187,14 @@ def test_value_stored_as_f_object(self, store: OpenSearchStore, opensearch_clien
187187
doc_id = store._get_document_id(key="test_key") # pyright: ignore[reportPrivateUsage]
188188

189189
response = opensearch_client.get(index=index_name, id=doc_id)
190-
assert response.body["_source"] == snapshot(
190+
assert response["_source"] == snapshot(
191191
{"value": {"flat": {"name": "Alice", "age": 30}}, "created_at": IsStr(min_length=20, max_length=40)}
192192
)
193193

194194
# Test with TTL
195195
store.put(collection="test", key="test_key", value={"name": "Bob", "age": 25}, ttl=10)
196196
response = opensearch_client.get(index=index_name, id=doc_id)
197-
assert response.body["_source"] == snapshot(
197+
assert response["_source"] == snapshot(
198198
{
199199
"value": {"flat": {"name": "Bob", "age": 25}},
200200
"created_at": IsStr(min_length=20, max_length=40),

0 commit comments

Comments
 (0)