douyinWEB/backend/tests/test_ops_neko_catalog.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

30 lines
847 B
Python

# -*- coding: utf-8 -*-
from __future__ import annotations
from app import ops_neko_db
def test_edge_catalog_upsert_and_list(temp_db) -> None:
rows = ops_neko_db.upsert_edge_catalog(
[
{
"id": "a",
"slot": 1,
"name": "N1",
"open_url": "https://dy.nomadro.cn/ops-neko/1/",
"running": True,
},
{
"slot": 2,
"name": "N2",
"open_url": "https://dy.nomadro.cn/ops-neko/2/",
"running": False,
},
],
edge_id="phys1",
edge_label="phys1",
)
assert len(rows) >= 2
listed = ops_neko_db.list_edge_catalog(max_age_sec=3600)
assert any(r.get("slot") == 1 and "ops-neko/1" in str(r.get("open_url")) for r in listed)