feat(pack): add official provider templates and loader test
- Add first batch of 10 official provider templates (qwen, glm, kimi, minimax, deepseek, step) - Add TestLoadPathIncludesFirstBatchOfficialProviders to verify pack loads all templates - Regenerate checksums.txt with all official provider files - Bump pack version 1.0.1 -> 1.1.0 - Update README with provider manifest index and import examples
This commit is contained in:
@@ -19,6 +19,36 @@ func TestLoadPathSupportsDirectory(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestLoadPathIncludesFirstBatchOfficialProviders(t *testing.T) {
|
||||
loaded, err := LoadPath(filepath.Join("..", "..", "packs", "openai-cn-pack"))
|
||||
if err != nil {
|
||||
t.Fatalf("LoadPath(dir) error = %v", err)
|
||||
}
|
||||
|
||||
got := make(map[string]struct{}, len(loaded.Providers))
|
||||
for _, provider := range loaded.Providers {
|
||||
got[provider.ProviderID] = struct{}{}
|
||||
}
|
||||
|
||||
want := []string{
|
||||
"qwen-official",
|
||||
"qwen-coder-official",
|
||||
"deepseek-chat-official",
|
||||
"deepseek-reasoner-official",
|
||||
"glm-5-1-official",
|
||||
"glm-4-7-official",
|
||||
"kimi-k2-5-official",
|
||||
"kimi-k2-thinking-official",
|
||||
"minimax-m2-7-official",
|
||||
"step-3-5-flash-official",
|
||||
}
|
||||
for _, providerID := range want {
|
||||
if _, ok := got[providerID]; !ok {
|
||||
t.Fatalf("Providers missing %q; got %v", providerID, providerIDs(loaded.Providers))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestLoadPathSupportsZipArchive(t *testing.T) {
|
||||
tempDir := t.TempDir()
|
||||
archivePath := filepath.Join(tempDir, "openai-cn-pack.zip")
|
||||
@@ -86,3 +116,11 @@ func writePackArchive(t *testing.T, archivePath string) {
|
||||
t.Fatalf("Close archive writer: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
func providerIDs(providers []ProviderManifest) []string {
|
||||
ids := make([]string, 0, len(providers))
|
||||
for _, provider := range providers {
|
||||
ids = append(ids, provider.ProviderID)
|
||||
}
|
||||
return ids
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user