Files
dingtalk-workspace-cli/pkg/edition/edition_test.go
修雨 4c5f1faeb1 feat: align open CLI with dws-wukong via cedar discovery version code (#509)
Switches the discovery version code bamboo -> cedar and aligns the open edition CLI with dws-wukong across communication (calendar book/acl/attendee, minutes tag, mail folder/template/contact, chat file upload, todo add-attachment, attendance transforms) and structured-office (aitable advperm/view/section/workflow/record, sheet/drive/wiki/doc) domains. Includes output-envelope parity, parse_bool/attendance_class_check_time transforms, --calendar-id support, CHANGELOG 1.0.43 and README command-index refresh. cedar config validated on pre and prod endpoints.
2026-06-26 21:49:38 +08:00

61 lines
1.8 KiB
Go

// Copyright 2026 Alibaba Group
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package edition
import "testing"
func TestClawTypeDefaultsToOSSValue(t *testing.T) {
prev := Get()
defer Override(prev)
Override(defaultHooks())
if got := ClawType(); got != DefaultOSSClawType {
t.Fatalf("ClawType() = %q, want %q", got, DefaultOSSClawType)
}
}
func TestClawTypeUsesOverlayValue(t *testing.T) {
prev := Get()
defer Override(prev)
Override(&Hooks{Name: "overlay", ClawTypeValue: "wukong"})
if got := ClawType(); got != "wukong" {
t.Fatalf("ClawType() = %q, want overlay value %q", got, "wukong")
}
}
func TestOpenSupplementServersIncludeAitableHelperAlias(t *testing.T) {
servers := openSupplementServers()
byID := make(map[string]ServerInfo, len(servers))
for _, server := range servers {
byID[server.ID] = server
}
helper, ok := byID["aitable-helper"]
if !ok {
t.Fatalf("openSupplementServers() missing aitable-helper: %#v", servers)
}
if helper.Endpoint != openAitableHelperEndpoint {
t.Fatalf("aitable-helper endpoint = %q, want %q", helper.Endpoint, openAitableHelperEndpoint)
}
form, ok := byID["aitable-form"]
if !ok {
t.Fatalf("openSupplementServers() missing aitable-form: %#v", servers)
}
if form.Endpoint != openAitableHelperEndpoint {
t.Fatalf("aitable-form endpoint = %q, want %q", form.Endpoint, openAitableHelperEndpoint)
}
}