Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

fix(tests): satisfy Ruff B903 for hit-test fake (#44299)

mika7b8797c361fd
diff --git a/api/tests/unit_tests/services/test_hit_testing_service.py b/api/tests/unit_tests/services/test_hit_testing_service.py
index 68edd7486a9..e3b2739068a 100644
--- a/api/tests/unit_tests/services/test_hit_testing_service.py
+++ b/api/tests/unit_tests/services/test_hit_testing_service.py
@@ -1,5 +1,6 @@
"""Unit tests for the database-independent hit-testing helpers."""
+from dataclasses import dataclass
from unittest.mock import patch
import pytest
@@ -39,11 +40,11 @@ class TestHitTestingServiceArguments:
HitTestingService.hit_testing_args_check({"attachment_ids": "not a list"})
+@dataclass
class _FakeSegment:
"""Minimal stand-in for a retrieval segment carrying a document id."""
- def __init__(self, document_id: str) -> None:
- self.document_id = document_id
+ document_id: str
class _FakeRetrievalRecord: