chore: 项目基线(基于 WeKnora 定制版,整理文件忽略规则)
This commit is contained in:
commit
9097ee699d
5769 files changed
+1446466
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