Files
wehub-resource-sync f36e2104d8
tests / ragflow_tests_infinity (push) Has been cancelled
tests / ragflow_tests_elasticsearch (push) Has been cancelled
sep-tests / ragflow_preflight (push) Has been cancelled
sep-tests / ragflow_tests_infinity (push) Has been cancelled
sep-tests / ragflow_tests_elasticsearch (push) Has been cancelled
tests / ragflow_preflight (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:16:49 +08:00

68 lines
1.8 KiB
Go

package models
import "testing"
func TestXunFeiUnsupportedMethodsReturnNoSuchMethod(t *testing.T) {
driver := NewXunFeiModel(map[string]string{"default": "http://unused"}, URLSuffix{}).
NewInstance(map[string]string{"default": "http://unused"})
modelName := "spark"
text := "hello"
checks := []struct {
name string
call func() error
}{
{"Embed", func() error {
_, err := driver.Embed(&modelName, []string{text}, &APIConfig{}, nil)
return err
}},
{"Rerank", func() error {
_, err := driver.Rerank(&modelName, text, []string{text}, &APIConfig{}, nil)
return err
}},
{"TranscribeAudio", func() error {
_, err := driver.TranscribeAudio(&modelName, &text, &APIConfig{}, nil)
return err
}},
{"TranscribeAudioWithSender", func() error {
return driver.TranscribeAudioWithSender(&modelName, &text, &APIConfig{}, nil, nil)
}},
{"AudioSpeech", func() error {
_, err := driver.AudioSpeech(&modelName, &text, &APIConfig{}, nil)
return err
}},
{"AudioSpeechWithSender", func() error {
return driver.AudioSpeechWithSender(&modelName, &text, &APIConfig{}, nil, nil)
}},
{"OCRFile", func() error {
_, err := driver.OCRFile(&modelName, nil, &text, &APIConfig{}, nil)
return err
}},
{"ParseFile", func() error {
_, err := driver.ParseFile(&modelName, nil, &text, &APIConfig{}, nil)
return err
}},
{"Balance", func() error {
_, err := driver.Balance(&APIConfig{})
return err
}},
{"CheckConnection", func() error {
return driver.CheckConnection(&APIConfig{})
}},
{"ListTasks", func() error {
_, err := driver.ListTasks(&APIConfig{})
return err
}},
{"ShowTask", func() error {
_, err := driver.ShowTask("task-id", &APIConfig{})
return err
}},
}
for _, check := range checks {
t.Run(check.name, func(t *testing.T) {
requireNoSuchMethod(t, check.name, check.call())
})
}
}