douyinWEB/backend/tests/test_assign_category.py
eric dea036c50d Prefer YouTube receiving/Studio on-air for live-map and sync assign lives to hub.
Tighten http/youtubei live probes, classify Studio encoder_lost vs waiting, and keep dy/dylive public live counts aligned via edge assign_lives.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-05 22:57:52 -05:00

22 lines
929 B
Python

# -*- coding: utf-8 -*-
from app.yt_assign_db import group_is_time_slot, normalize_assign_category
def test_normalize_assign_category():
assert normalize_assign_category("normal") == "normal"
assert normalize_assign_category("普通") == "normal"
assert normalize_assign_category("") == "normal"
assert normalize_assign_category(None) == "normal"
assert normalize_assign_category("time_slot") == "time_slot"
assert normalize_assign_category("时间段") == "time_slot"
assert normalize_assign_category("timeslot") == "time_slot"
assert normalize_assign_category("weird") == "normal"
def test_group_is_time_slot():
assert group_is_time_slot({"category": "time_slot"}) is True
assert group_is_time_slot({"category": "normal"}) is False
assert group_is_time_slot({"category": "普通"}) is False
assert group_is_time_slot({}) is False
assert group_is_time_slot(None) is False