Skip to content

Commit

Permalink
chore: extend test
Browse files Browse the repository at this point in the history
  • Loading branch information
frascuchon committed Jan 21, 2025
1 parent e54379e commit 57468ce
Showing 1 changed file with 25 additions and 3 deletions.
28 changes: 25 additions & 3 deletions argilla-server/tests/unit/search_engine/test_commons.py
Original file line number Diff line number Diff line change
Expand Up @@ -1007,7 +1007,18 @@ async def test_index_records_with_none_field_values(
responses=[],
)

records = [record]
other_record = await RecordFactory.create(
dataset=dataset,
fields={
text_field.name: "This is the value for text",
image_field.name: "https://random.url/image",
chat_field.name: [{"role": "user", "content": "Hello world"}, {"role": "bot", "content": "Hi"}],
custom_field.name: {"a": "This is a value", "b": 100},
},
responses=[],
)

records = [record, other_record]

await refresh_dataset(dataset)
await refresh_records(records)
Expand All @@ -1031,8 +1042,19 @@ async def test_index_records_with_none_field_values(
"status": RecordStatus.pending,
"inserted_at": record.inserted_at.isoformat(),
"updated_at": record.updated_at.isoformat(),
}
for record in records
},
{
"id": str(other_record.id),
"fields": {
text_field.name: other_record.fields[text_field.name],
chat_field.name: other_record.fields[chat_field.name],
custom_field.name: other_record.fields[custom_field.name],
},
"external_id": other_record.external_id,
"status": RecordStatus.pending,
"inserted_at": other_record.inserted_at.isoformat(),
"updated_at": other_record.updated_at.isoformat(),
},
]

async def test_configure_metadata_property(
Expand Down

0 comments on commit 57468ce

Please sign in to comment.