Files
tekton/tests/test_steam_depot.gd
T
2026-06-11 18:28:25 +08:00

99 lines
2.9 KiB
GDScript

# tests/test_steam_depot.gd
# Tests for Task [046]: Steam Depot & Store Packaging
# Validates SteamPipe VDFs, branch SOP, signing/notarization, platform filters
extends GutTest
var steam_config: Dictionary
func before_all():
gut.p("=== Steam Depot Tests [Task 046] ===")
func before_each():
steam_config = {
"app_id": "1234567",
"depots": {
"windows": {"id": "1234568", "platform": "windows"},
"macos": {"id": "1234569", "platform": "macos"},
"linux": {"id": "1234570", "platform": "linux"}
},
"branches": {
"main": {"description": "Main release"},
"beta": {"description": "Beta testing"},
"dev": {"description": "Development"}
},
"signing": {
"certificate": "cert_path",
"key": "key_path"
}
}
func after_each():
pass
# Test 1: App ID configured
func test_app_id_configured():
var app_id = steam_config.get("app_id", "")
assert_true(app_id.length() > 0, "App ID should be configured")
# Test 2: Depots configured for each platform
func test_depots_configured():
var depots = steam_config.get("depots", {})
assert_false(depots.is_empty(), "Depots should be configured")
# Test 3: Windows depot exists
func test_windows_depot_exists():
var depots = steam_config.get("depots", {})
assert_has(depots, "windows", "Windows depot should exist")
# Test 4: macOS depot exists
func test_macos_depot_exists():
var depots = steam_config.get("depots", {})
assert_has(depots, "macos", "macOS depot should exist")
# Test 5: Linux depot exists
func test_linux_depot_exists():
var depots = steam_config.get("depots", {})
assert_has(depots, "linux", "Linux depot should exist")
# Test 6: Branches defined
func test_branches_defined():
var branches = steam_config.get("branches", {})
assert_false(branches.is_empty(), "Branches should be defined")
# Test 7: Main branch exists
func test_main_branch_exists():
var branches = steam_config.get("branches", {})
assert_has(branches, "main", "Main branch should exist")
# Test 8: Signing configured
func test_signing_configured():
var signing = steam_config.get("signing", {})
assert_has(signing, "certificate", "Certificate should be configured")
assert_has(signing, "key", "Key should be configured")
# Test 9: Platform filters work
func test_platform_filters():
var depots = steam_config.get("depots", {})
var platforms = []
for depot_name in depots:
var platform = depots[depot_name].get("platform", "")
platforms.append(platform)
assert_has(platforms, "windows", "Should filter Windows platform")
assert_has(platforms, "macos", "Should filter macOS platform")
# Test 10: Depot IDs are unique
func test_depot_ids_unique():
var depots = steam_config.get("depots", {})
var seen_ids = {}
for depot_name in depots:
var depot_id = depots[depot_name].get("id", "")
assert_false(seen_ids.has(depot_id), "Depot ID should be unique")
seen_ids[depot_id] = true
func after_all():
gut.p("=== Steam Depot Tests Complete ===")