mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-07-23 17:06:42 +08:00
Add Go service/handler tests for API contract parity (#16905)
This commit is contained in:
@@ -83,15 +83,9 @@ def test_chunk_shape_helper_recognises_chunk_payloads(monkeypatch):
|
||||
"""A response that is chunk-shaped (list, or dict with non-empty results/chunks)
|
||||
is classified as chunked regardless of which payload was sent."""
|
||||
module = _load_docling_parser(monkeypatch)
|
||||
assert module.DoclingParser._looks_like_chunk_response(
|
||||
[{"text": "chunk-1"}]
|
||||
) is True
|
||||
assert module.DoclingParser._looks_like_chunk_response(
|
||||
{"results": [{"text": "chunk-1"}, {"text": "chunk-2"}]}
|
||||
) is True
|
||||
assert module.DoclingParser._looks_like_chunk_response(
|
||||
{"chunks": [{"text": "chunk-1"}]}
|
||||
) is True
|
||||
assert module.DoclingParser._looks_like_chunk_response([{"text": "chunk-1"}]) is True
|
||||
assert module.DoclingParser._looks_like_chunk_response({"results": [{"text": "chunk-1"}, {"text": "chunk-2"}]}) is True
|
||||
assert module.DoclingParser._looks_like_chunk_response({"chunks": [{"text": "chunk-1"}]}) is True
|
||||
|
||||
|
||||
@pytest.mark.p2
|
||||
@@ -164,4 +158,4 @@ def test_remote_chunked_request_with_ignored_flag_does_not_log_success(monkeypat
|
||||
assert sections == [("real content", "")]
|
||||
flat = " ".join(record.getMessage() for record in caplog.records)
|
||||
assert "Successfully used native chunking" not in flat
|
||||
assert "Server ignored chunking request" in flat
|
||||
assert "Server ignored chunking request" in flat
|
||||
|
||||
Reference in New Issue
Block a user