feat: add customer portal and RTC voice diagnostics
This commit is contained in:
@@ -89,6 +89,23 @@ func TestVolcengineClientClassifiesRateLimitAndDuplicateStart(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestVolcengineClientPreservesProviderErrorOnNonSuccessHTTPStatus(t *testing.T) {
|
||||
server := httptest.NewServer(http.HandlerFunc(func(writer http.ResponseWriter, _ *http.Request) {
|
||||
writer.WriteHeader(http.StatusNotFound)
|
||||
_ = json.NewEncoder(writer).Encode(map[string]any{"ResponseMetadata": map[string]any{"Error": map[string]any{
|
||||
"Code": "InvalidParameter.AppId", "Message": "application was not found",
|
||||
}}})
|
||||
}))
|
||||
defer server.Close()
|
||||
client := newTestVolcengineClient(t, server.URL)
|
||||
_, err := client.Start(context.Background(), StartRequest{
|
||||
TaskRef: "task-1", RoomID: "room-1", DeviceUserID: "device-1", AgentUserID: "agent-1", EngineMode: "s2s_hybrid",
|
||||
})
|
||||
if err == nil || !strings.Contains(err.Error(), "InvalidParameter.AppId") || !strings.Contains(err.Error(), "application was not found") {
|
||||
t.Fatalf("provider error details were lost: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestVolcengineClientRejectsUneditedExampleTemplate(t *testing.T) {
|
||||
_, err := NewVolcengineClient(VolcengineOptions{
|
||||
BaseURL: "https://rtc.volcengineapi.com", AccessKeyID: strings.Repeat("a", 32), SecretAccessKey: strings.Repeat("s", 40),
|
||||
|
||||
Reference in New Issue
Block a user