refactor(core): 模型路由与画布 - 收敛渠道模型映射并优化交互
This commit is contained in:
1 parent
52424543ea
commit
d47975f9bc
34 files changed
+601
-901
No files matched your search
@@ -150,23 +150,11 @@ func TestLogicalModelAvailabilityErrorRequiresSettlementReadyCoverage(t *testing
|
||||
}
|
||||
}
|
||||
|
||||
func TestOptionConstraintWithinRejectsFinerStepThanRealModel(t *testing.T) {
|
||||
physical := numericRange(6, 18, 6)
|
||||
tooBroad := numericRange(6, 18, 3)
|
||||
if optionConstraintWithin(tooBroad, physical) {
|
||||
t.Fatal("a route step finer than the channel model step was accepted")
|
||||
}
|
||||
if !optionConstraintWithin(numericRange(6, 18, 6), physical) {
|
||||
t.Fatal("the channel model step was rejected")
|
||||
}
|
||||
}
|
||||
|
||||
func TestValidateVariantWithinChannelModelRequiresExplicitImageCapability(t *testing.T) {
|
||||
func TestChannelModelCapabilitySpecRequiresExplicitImageCapability(t *testing.T) {
|
||||
channelModel := model.ChannelModel{Capability: "image", CapabilityConfigJSON: ""}
|
||||
spec := CapabilitySpec{Version: 1, Capability: "image"}
|
||||
|
||||
err := validateVariantWithinChannelModel(channelModel, spec)
|
||||
_, err := channelModelCapabilitySpec(channelModel)
|
||||
if err == nil || !strings.Contains(err.Error(), "渠道图片模型尚未配置能力参数") {
|
||||
t.Fatalf("validateVariantWithinChannelModel() error = %v", err)
|
||||
t.Fatalf("channelModelCapabilitySpec() error = %v", err)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user