fix(ingest): raise ref cap to 50 and clarify invalid bvid error
This commit is contained in:
1 parent
b5bf7d9b8f
commit
b0c53e8a2f
7 files changed
+107
-9
No files matched your search
@@ -63,6 +63,17 @@ def test_limit():
|
||||
assert len(extract_video_refs(text, limit=None)) == 3
|
||||
|
||||
|
||||
def test_default_cap_allows_bulk_paste():
|
||||
from reaction_board.video_ref import DEFAULT_MAX_REFS
|
||||
|
||||
assert DEFAULT_MAX_REFS >= 15
|
||||
text = " ".join(f"BV1x8x166E{i:02d}" for i in range(15))
|
||||
assert len(extract_video_refs(text)) == 15
|
||||
assert len(extract_video_refs(" ".join(
|
||||
f"BV1x8x166E{i:02d}" for i in range(DEFAULT_MAX_REFS + 5)
|
||||
))) == DEFAULT_MAX_REFS
|
||||
|
||||
|
||||
def test_invalid_and_boundaries():
|
||||
assert extract_video_refs("") == []
|
||||
assert extract_video_refs(None) == []
|
||||
@@ -85,6 +96,7 @@ def main():
|
||||
test_short_link()
|
||||
test_multiple_and_order_and_dedup()
|
||||
test_limit()
|
||||
test_default_cap_allows_bulk_paste()
|
||||
test_invalid_and_boundaries()
|
||||
print("OK: 视频引用(BV/av/URL/短链)解析测试全部通过")
|
||||
|
||||
|
||||
Reference in new issue
Block a user