fix: 补充 auto-format 格式修复到 main #1700

Merged
xiaoxia merged 1 commits from fix/style-main-sync into main 2026-09-04 23:53:39 +08:00
+11 -6
View File
@@ -191,18 +191,23 @@ class TestComputeDuplicateRateFormula:
deduplicator = VideoDeduplicator()
# 10 frames with varied phashes (2 unique) → not bad fingerprint
# All close in hamming distance to existing → frame_match_rate = 1.0
phashes = (["aa00aa00aa00aa00", "ab00ab00ab00ab00"] * 5)
phashes = ["aa00aa00aa00aa00", "ab00ab00ab00ab00"] * 5
fingerprint = _make_fingerprint(md5="new", phashes=phashes, duration_ms=20000)
session = MagicMock()
# 5 unique phashes to pass _is_bad_fingerprint check (PR #1688)
existing = _make_video(
"vid2",
{"md5": "other", "keyframe_phashes": [
"aa00aa00aa00aa00", "ab00ab00ab00ab00",
"ac00ac00ac00ac00", "aa10aa10aa10aa10",
"ba00ba00ba00ba00",
]},
{
"md5": "other",
"keyframe_phashes": [
"aa00aa00aa00aa00",
"ab00ab00ab00ab00",
"ac00ac00ac00ac00",
"aa10aa10aa10aa10",
"ba00ba00ba00ba00",
],
},
)
with patch("video_processing.dedup.SQLAlchemyGeneratedVideoRepository") as MockRepo: