mirror of
https://github.com/hansjone/oclaw.git
synced 2026-10-10 05:10:45 +08:00
同时收敛启动与运维脚本默认行为(含 wiki worker)、更新 Admin 可观测性与相关测试,降低首轮时延并提高运行稳定性。 Made-with: Cursor
27 lines
1.2 KiB
Swift
27 lines
1.2 KiB
Swift
import Testing
|
|
@testable import OpenClaw
|
|
|
|
struct GatewayAgentChannelTests {
|
|
@Test func `should deliver blocks web chat`() {
|
|
#expect(GatewayAgentChannel.webchat.shouldDeliver(true) == false)
|
|
#expect(GatewayAgentChannel.webchat.shouldDeliver(false) == false)
|
|
}
|
|
|
|
@Test func `should deliver allows last and provider channels`() {
|
|
#expect(GatewayAgentChannel.last.shouldDeliver(true) == true)
|
|
#expect(GatewayAgentChannel.whatsapp.shouldDeliver(true) == true)
|
|
#expect(GatewayAgentChannel.telegram.shouldDeliver(true) == true)
|
|
#expect(GatewayAgentChannel.googlechat.shouldDeliver(true) == true)
|
|
#expect(GatewayAgentChannel.bluebubbles.shouldDeliver(true) == true)
|
|
#expect(GatewayAgentChannel.last.shouldDeliver(false) == false)
|
|
}
|
|
|
|
@Test func `init raw normalizes and falls back to last`() {
|
|
#expect(GatewayAgentChannel(raw: nil) == .last)
|
|
#expect(GatewayAgentChannel(raw: " ") == .last)
|
|
#expect(GatewayAgentChannel(raw: "WEBCHAT") == .webchat)
|
|
#expect(GatewayAgentChannel(raw: "googlechat") == .googlechat)
|
|
#expect(GatewayAgentChannel(raw: "BLUEBUBBLES") == .bluebubbles)
|
|
#expect(GatewayAgentChannel(raw: "unknown") == .last)
|
|
}
|
|
}
|