fix pipelines
This commit is contained in:
@@ -30,6 +30,50 @@ def test_parse_clip_response():
|
||||
assert candidates[0].title_zh == "标题"
|
||||
|
||||
|
||||
def test_parse_clip_response_accepts_candidates_key_and_score_out_of_ten():
|
||||
candidates = parse_clip_response(
|
||||
"""
|
||||
{
|
||||
"candidates": [
|
||||
{
|
||||
"start_sec": 10,
|
||||
"end_sec": 60,
|
||||
"title_zh": "标题",
|
||||
"summary_zh": "摘要",
|
||||
"reason": "有趣",
|
||||
"score": 8.5,
|
||||
"tags": ["反应"],
|
||||
"subtitle_priority": "high"
|
||||
}
|
||||
]
|
||||
}
|
||||
"""
|
||||
)
|
||||
assert candidates[0].score == 0.85
|
||||
|
||||
|
||||
def test_parse_clip_response_normalizes_score_out_of_hundred():
|
||||
candidates = parse_clip_response(
|
||||
"""
|
||||
{
|
||||
"clips": [
|
||||
{
|
||||
"start_sec": 10,
|
||||
"end_sec": 60,
|
||||
"title_zh": "标题",
|
||||
"summary_zh": "摘要",
|
||||
"reason": "有趣",
|
||||
"score": 92,
|
||||
"tags": ["反应"],
|
||||
"subtitle_priority": "high"
|
||||
}
|
||||
]
|
||||
}
|
||||
"""
|
||||
)
|
||||
assert candidates[0].score == 0.92
|
||||
|
||||
|
||||
def test_dedupe_and_rank_candidates_filters_short_and_overlapping():
|
||||
candidates = [
|
||||
ClipCandidate(
|
||||
|
||||
Reference in New Issue
Block a user