feat: 增加计费预估核对运维流程
This commit is contained in:
@@ -14,13 +14,13 @@ func TestLoadMetadata(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatalf("load metadata: %v", err)
|
||||
}
|
||||
if metadata.Name != Name || metadata.Version != "1.0.1" {
|
||||
if metadata.Name != Name || metadata.Version != "1.0.2" {
|
||||
t.Fatalf("unexpected metadata: %+v", metadata)
|
||||
}
|
||||
if !slices.Equal(metadata.Modules, []string{"model-runtime"}) {
|
||||
t.Fatalf("unexpected modules: %+v", metadata.Modules)
|
||||
}
|
||||
if FileName(metadata) != "ai-gateway-ops-management-v1.0.1.zip" {
|
||||
if FileName(metadata) != "ai-gateway-ops-management-v1.0.2.zip" {
|
||||
t.Fatalf("unexpected file name: %s", FileName(metadata))
|
||||
}
|
||||
}
|
||||
@@ -48,6 +48,7 @@ func TestBuildArchiveContainsOperationsSkill(t *testing.T) {
|
||||
"references/api-discovery-and-safety.md",
|
||||
"references/model-providers-and-base-models.md",
|
||||
"references/model-pricing-and-policies.md",
|
||||
"references/model-billing-configuration-and-estimation.md",
|
||||
"references/model-platforms-and-bindings.md",
|
||||
"references/model-universal-platforms.md",
|
||||
"references/model-acceptance-runbook.md",
|
||||
@@ -69,6 +70,20 @@ func TestBuildArchiveContainsOperationsSkill(t *testing.T) {
|
||||
if !strings.Contains(string(skillContent), "name: "+Name) {
|
||||
t.Fatalf("SKILL.md frontmatter has unexpected name")
|
||||
}
|
||||
billingFile, err := files["references/model-billing-configuration-and-estimation.md"].Open()
|
||||
if err != nil {
|
||||
t.Fatalf("open billing reference: %v", err)
|
||||
}
|
||||
defer billingFile.Close()
|
||||
billingContent, err := io.ReadAll(billingFile)
|
||||
if err != nil {
|
||||
t.Fatalf("read billing reference: %v", err)
|
||||
}
|
||||
for _, required := range []string{"/api/v1/pricing/estimate", "finalChargeAmount", "transactionType=task_billing"} {
|
||||
if !strings.Contains(string(billingContent), required) {
|
||||
t.Fatalf("billing reference missing %q", required)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func archiveFileNames(files []*zip.File) []string {
|
||||
|
||||
Reference in New Issue
Block a user