mirror of
https://github.com/semantica-agi/semantica.git
synced 2026-08-29 04:26:20 +00:00
23 lines
552 B
Python
23 lines
552 B
Python
import pytest
|
|
|
|
from semantica.ingest.file_ingestor import FileIngestor
|
|
|
|
|
|
def test_ingest_file_performance(benchmark, sample_text_file):
|
|
"""
|
|
Benchmarks the speed of the ingest_file method
|
|
|
|
Metrics:
|
|
- Time to open, read, validate and wrap a ~~10 KB text file.
|
|
"""
|
|
|
|
ingestor = FileIngestor()
|
|
result = benchmark(
|
|
ingestor.ingest_file, file_path=sample_text_file, read_content=True
|
|
)
|
|
|
|
assert result is not None
|
|
assert result.size > 0
|
|
assert result.name.endswith(".txt")
|
|
assert "Line 0" in result.text
|