o2o-plagiarism-ai/tests/test_summary_annotation_packet.py

13 lines
482 B
Python

from scripts.build_summary_annotation_packet import select_group_diverse
def test_select_group_diverse_takes_each_group_before_seconds():
rows = [
{"source_group": "a", "row_key": "a1"},
{"source_group": "a", "row_key": "a2"},
{"source_group": "b", "row_key": "b1"},
{"source_group": "c", "row_key": "c1"},
]
selected = select_group_diverse(rows, limit=3, seed=1)
assert {row["source_group"] for row in selected} == {"a", "b", "c"}