Add ez-assistant and kerberos service folders

This commit is contained in:
kelin
2026-02-11 14:56:03 -05:00
parent e4e8ae1b87
commit 9ccfb36923
4471 changed files with 746463 additions and 0 deletions

View File

@@ -0,0 +1,67 @@
import Foundation
import Testing
@testable import Moltbot
@Suite struct WebChatMainSessionKeyTests {
@Test func configGetSnapshotMainKeyFallsBackToMainWhenMissing() throws {
let json = """
{
"path": "/Users/pete/.clawdbot/moltbot.json",
"exists": true,
"raw": null,
"parsed": {},
"valid": true,
"config": {},
"issues": []
}
"""
let key = try GatewayConnection.mainSessionKey(fromConfigGetData: Data(json.utf8))
#expect(key == "main")
}
@Test func configGetSnapshotMainKeyTrimsAndUsesValue() throws {
let json = """
{
"path": "/Users/pete/.clawdbot/moltbot.json",
"exists": true,
"raw": null,
"parsed": {},
"valid": true,
"config": { "session": { "mainKey": " primary " } },
"issues": []
}
"""
let key = try GatewayConnection.mainSessionKey(fromConfigGetData: Data(json.utf8))
#expect(key == "main")
}
@Test func configGetSnapshotMainKeyFallsBackWhenEmptyOrWhitespace() throws {
let json = """
{
"config": { "session": { "mainKey": " " } }
}
"""
let key = try GatewayConnection.mainSessionKey(fromConfigGetData: Data(json.utf8))
#expect(key == "main")
}
@Test func configGetSnapshotMainKeyFallsBackWhenConfigNull() throws {
let json = """
{
"config": null
}
"""
let key = try GatewayConnection.mainSessionKey(fromConfigGetData: Data(json.utf8))
#expect(key == "main")
}
@Test func configGetSnapshotUsesGlobalScope() throws {
let json = """
{
"config": { "session": { "scope": "global" } }
}
"""
let key = try GatewayConnection.mainSessionKey(fromConfigGetData: Data(json.utf8))
#expect(key == "global")
}
}