chore: 初始化仓库,导入项目基线代码
Academy v0.8.3 完整代码基线:Go 后端(internal/cmd/cli/mcp-server/docreader)、 Vue 前端(frontend)、数据库迁移(migrations)、部署编排(docker/helm/deploy)与文档。 今日开发的培训推送管理改动随后单独提交。
This commit is contained in:
commit
7ec21f35b0
5767 files changed
+1436788
No files matched your search
@@ -0,0 +1,33 @@
|
||||
package handler
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
// The channel-creation endpoint rejects any platform without a registered
|
||||
// adapter factory, so this set must track the factories wired in the container.
|
||||
func TestValidIMPlatforms_CoversLark(t *testing.T) {
|
||||
want := []string{
|
||||
"wecom", "feishu", "lark", "slack", "telegram",
|
||||
"dingtalk", "mattermost", "wechat", "qqbot",
|
||||
}
|
||||
for _, platform := range want {
|
||||
if !validIMPlatforms[platform] {
|
||||
t.Errorf("platform %q is not accepted", platform)
|
||||
}
|
||||
}
|
||||
if validIMPlatforms["nonsense"] {
|
||||
t.Error("unknown platform is accepted")
|
||||
}
|
||||
}
|
||||
|
||||
// The 400 message is derived from validIMPlatforms; it must not drift as
|
||||
// platforms are added.
|
||||
func TestInvalidIMPlatformError_ListsEveryPlatform(t *testing.T) {
|
||||
for platform := range validIMPlatforms {
|
||||
if !strings.Contains(invalidIMPlatformError, "'"+platform+"'") {
|
||||
t.Errorf("error message omits %q: %s", platform, invalidIMPlatformError)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user