mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-06-26 21:39:43 +02:00
chore: ran linting
This commit is contained in:
parent
380c1c3877
commit
25df3dff64
3 changed files with 17 additions and 10 deletions
|
|
@ -1303,10 +1303,9 @@ class ConnectorService:
|
||||||
|
|
||||||
sources_list = self._build_chunk_sources_from_documents(
|
sources_list = self._build_chunk_sources_from_documents(
|
||||||
github_docs,
|
github_docs,
|
||||||
description_fn=lambda chunk, _doc_info, metadata: metadata.get(
|
description_fn=lambda chunk, _doc_info, metadata: (
|
||||||
"description"
|
metadata.get("description") or chunk.get("content", "")
|
||||||
)
|
),
|
||||||
or chunk.get("content", ""),
|
|
||||||
url_fn=lambda _doc_info, metadata: metadata.get("url", "") or "",
|
url_fn=lambda _doc_info, metadata: metadata.get("url", "") or "",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -175,7 +175,10 @@ class TestPageLimitNotification:
|
||||||
)
|
)
|
||||||
|
|
||||||
latest = notifications[0]
|
latest = notifications[0]
|
||||||
assert "page limit" in latest["title"].lower() or "page limit" in latest["message"].lower(), (
|
assert (
|
||||||
|
"page limit" in latest["title"].lower()
|
||||||
|
or "page limit" in latest["message"].lower()
|
||||||
|
), (
|
||||||
f"Notification should mention page limit: title={latest['title']!r}, "
|
f"Notification should mention page limit: title={latest['title']!r}, "
|
||||||
f"message={latest['message']!r}"
|
f"message={latest['message']!r}"
|
||||||
)
|
)
|
||||||
|
|
@ -217,7 +220,11 @@ class TestDocumentProcessingNotification:
|
||||||
type_filter="document_processing",
|
type_filter="document_processing",
|
||||||
search_space_id=search_space_id,
|
search_space_id=search_space_id,
|
||||||
)
|
)
|
||||||
completed = [n for n in notifications if n.get("metadata", {}).get("processing_stage") == "completed"]
|
completed = [
|
||||||
|
n
|
||||||
|
for n in notifications
|
||||||
|
if n.get("metadata", {}).get("processing_stage") == "completed"
|
||||||
|
]
|
||||||
assert len(completed) >= 1, (
|
assert len(completed) >= 1, (
|
||||||
"Expected at least one document_processing notification with 'completed' stage"
|
"Expected at least one document_processing notification with 'completed' stage"
|
||||||
)
|
)
|
||||||
|
|
@ -257,9 +264,7 @@ class TestPagesUnchangedOnProcessingFailure:
|
||||||
assert statuses[did]["status"]["state"] == "failed"
|
assert statuses[did]["status"]["state"] == "failed"
|
||||||
|
|
||||||
used, _ = await page_limits.get()
|
used, _ = await page_limits.get()
|
||||||
assert used == 10, (
|
assert used == 10, f"pages_used should remain 10 after ETL failure, got {used}"
|
||||||
f"pages_used should remain 10 after ETL failure, got {used}"
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -130,7 +130,10 @@ class TestTotalSizeLimit:
|
||||||
):
|
):
|
||||||
chunk_size = 45 * 1024 * 1024 # 45 MB each
|
chunk_size = 45 * 1024 * 1024 # 45 MB each
|
||||||
files = [
|
files = [
|
||||||
("files", (f"chunk_{i}.txt", io.BytesIO(b"\x00" * chunk_size), "text/plain"))
|
(
|
||||||
|
"files",
|
||||||
|
(f"chunk_{i}.txt", io.BytesIO(b"\x00" * chunk_size), "text/plain"),
|
||||||
|
)
|
||||||
for i in range(5) # 5 x 45 MB = 225 MB > 200 MB
|
for i in range(5) # 5 x 45 MB = 225 MB > 200 MB
|
||||||
]
|
]
|
||||||
resp = await client.post(
|
resp = await client.post(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue