no message
This commit is contained in:
@@ -21,10 +21,11 @@ def main() -> None:
|
||||
|
||||
assert 'v-if="liveList.length"' in detail_source, "match detail should render live_list block with v-if"
|
||||
assert 'v-else-if="thirdPartyLiveUrl"' in detail_source, "match detail should keep thirdPartyLiveUrl fallback with v-else-if"
|
||||
assert "MatchLivePopup" in detail_source, "match detail should use MatchLivePopup"
|
||||
assert 'v-if="showLiveLineSelector"' in detail_source, "match detail should render inline live line selector"
|
||||
assert "fetch_status" in detail_source, "match detail should reference fetch_status"
|
||||
assert "last_fetch_at" in detail_source, "match detail should reference last_fetch_at"
|
||||
assert "update_time" in detail_source, "match detail should reference update_time"
|
||||
assert ':show-progress="false"' in detail_source, "match detail live video should hide time progress"
|
||||
assert "default_play_url" in popup_source, "popup should prefer default_play_url"
|
||||
assert "stream_options" in popup_source, "popup should support stream_options"
|
||||
assert "/pages/webview/webview?url=" in popup_source, "selected stream should route through existing webview page"
|
||||
@@ -39,10 +40,10 @@ def main() -> None:
|
||||
assert field_name in popup_source, f"popup should cover {field_name}"
|
||||
assert field_name in api_source, f"match live types should cover {field_name}"
|
||||
|
||||
assert re.search(r"const\s+defaultPlayUrl\s*=\s*normalizeUrl\(props\.line\?\.default_play_url\)", popup_source), \
|
||||
"popup should explicitly prefer props.line?.default_play_url"
|
||||
assert re.search(r"defaultPlayUrl.*?resetSelected", popup_source, re.S), \
|
||||
"popup selection reset should prefer default_play_url"
|
||||
assert "push(line.default_play_url)" in popup_source, \
|
||||
"popup should explicitly prefer line.default_play_url in candidate collection"
|
||||
assert "selectedLineKey.value = lineOptions.value[0]?.key || ''" in popup_source, \
|
||||
"popup should reset to the first available line option"
|
||||
assert re.search(r"fetch_status.*last_fetch_at", popup_source, re.S) or "update_time" in popup_source, \
|
||||
"popup metadata should use fetch_status and last_fetch_at/update_time"
|
||||
assert re.search(r"normalized === '0'.*待抓取", popup_source, re.S), \
|
||||
|
||||
@@ -23,7 +23,7 @@ def main() -> None:
|
||||
assert MENU_SQL.is_file(), f"missing menu seed file: {MENU_SQL}"
|
||||
menu_sql = MENU_SQL.read_text(encoding="utf-8")
|
||||
normalized_menu_sql = " ".join(menu_sql.split())
|
||||
first_insert_block = menu_sql.split(";", 1)[0] + ";"
|
||||
first_insert_block = "INSERT INTO `la_system_menu`" + menu_sql.split("INSERT INTO `la_system_menu`", 1)[1].split(";", 1)[0] + ";"
|
||||
normalized_first_insert = " ".join(first_insert_block.split())
|
||||
|
||||
assert MATCH_LIVE_PAGE.is_file(), f"missing page file: {MATCH_LIVE_PAGE}"
|
||||
@@ -111,8 +111,8 @@ def main() -> None:
|
||||
"match.matchLive/detail",
|
||||
"match.matchLive/add",
|
||||
"match.matchLive/edit",
|
||||
"match.match/lists",
|
||||
"match.matchLive/delete",
|
||||
"/match/lists",
|
||||
):
|
||||
assert needle in menu_sql, f"{MENU_SQL} missing permission token: {needle}"
|
||||
|
||||
@@ -127,20 +127,28 @@ def main() -> None:
|
||||
|
||||
assert (
|
||||
"FROM `la_system_menu` parent" in menu_sql
|
||||
and "parent.`perms` = 'match.match/lists'" in menu_sql
|
||||
), f"{MENU_SQL} must bind the match live menu to parent match.match/lists explicitly"
|
||||
and "parent.`type` = 'M'" in menu_sql
|
||||
and "parent.`paths` = 'match'" in menu_sql
|
||||
), f"{MENU_SQL} must bind the match live menu to the top-level match catalogue explicitly"
|
||||
assert (
|
||||
"SELECT parent.`id`, 'C', '直播线路管理'" in menu_sql
|
||||
), f"{MENU_SQL} must insert the page menu only when the parent match.match/lists record exists"
|
||||
), f"{MENU_SQL} must insert the page menu only when the parent match catalogue record exists"
|
||||
assert (
|
||||
"WHERE parent.`perms` = 'match.match/lists' AND NOT EXISTS (" in normalized_first_insert
|
||||
), f"{MENU_SQL} first insert must combine parent binding with AND NOT EXISTS in a single WHERE predicate"
|
||||
"WHERE parent.`type` = 'M' AND parent.`paths` = 'match' AND NOT EXISTS (" in normalized_first_insert
|
||||
), f"{MENU_SQL} first insert must combine top-level match catalogue binding with AND NOT EXISTS in a single WHERE predicate"
|
||||
assert (
|
||||
"WHERE parent.`perms` = 'match.match/lists' WHERE NOT EXISTS (" not in normalized_first_insert
|
||||
"WHERE parent.`type` = 'M' AND parent.`paths` = 'match' WHERE NOT EXISTS (" not in normalized_first_insert
|
||||
), f"{MENU_SQL} first insert must not contain a second standalone WHERE NOT EXISTS after the parent WHERE"
|
||||
assert normalized_first_insert.count("WHERE") == 2, (
|
||||
f"{MENU_SQL} first insert should only have the outer WHERE plus the nested WHERE inside NOT EXISTS"
|
||||
)
|
||||
assert "UPDATE `la_system_menu` child" in menu_sql, f"{MENU_SQL} must repair existing live menu parent records"
|
||||
assert "child.`perms` = 'match.matchLive/index'" in normalized_menu_sql, (
|
||||
f"{MENU_SQL} must target the existing match.matchLive/index menu when repairing the parent node"
|
||||
)
|
||||
assert "child.`pid` <> parent.`id`" in normalized_menu_sql, (
|
||||
f"{MENU_SQL} repair statement must only move the live menu when it is attached to the wrong parent"
|
||||
)
|
||||
assert (
|
||||
"SELECT (SELECT `id` FROM `la_system_menu` WHERE `perms` = 'match.matchLive/index' LIMIT 1)" in normalized_menu_sql
|
||||
), f"{MENU_SQL} child permissions must bind to the inserted match.matchLive/index menu"
|
||||
|
||||
Reference in New Issue
Block a user